draw.post: Overlapping Plots of Posterior Distributions for Several...

Description Usage Arguments Examples

Description

Draw overlapping kernel density estimates of the posterior distributions of the parameters of the conditional or ordinary Dirichlet model, where the posteriors arise from different values of the Dirichlet precision parameter M.

Usage

1
draw.post(mcout,burnin=1000,ind.par=NULL,adjust=1,...)

Arguments

mcout

is a list. Each item in the list is a matrix of MCMC output, corresponding to different values of M, the precision parameter of the Dirichlet model. If the matrices are output from dirichlet.c, each matrix has ncycles +1 rows and m+2 columns, where m is the number of studies in the meta-analysis and ncycles is the number of runs of the Markov chain. The matrix output from the ordinary Dirichlet model function dirichlet.o is similar but has an additional column. The rows hold output from separate Markov chain runs (the first row is the initial values.) Columns 1 through m hold the individual study parameters, the ψ_i's. The next two columns hold the mean and standard deviation parameters of the centering normal distribution of the Dirichlet prior, mu and tau. In the case of the ordinary Dirichlet model, an additional column is added to hold the values of eta.

burnin

is the number of initial chains to omit from the estimates, must be no larger than ncycles - 10.

ind.par

an integer vector, containing indices of which columns of mcout to include in the plots. By default, only the posterior density estimates for the hyperparameters mu and {tau}, and for the ordinary Dirichlet--- \eqn{η}{eta}---are produced.

adjust

is the bin width argument for the call to the R base package function density.

...

additional arguments to plot may be supplied.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 
## Conditional Dirichlet model

## Set up the breast cancer dataset.

data(breast.17) 
breast.data <- as.matrix(breast.17) # Data must be a matrix object.

##  Generate at least two chains, from models which are the same except
## for different \eqn{M}{M} values.

set.seed(1) # initialize the seed at 1 for test purposes
breast.c1 <- dirichlet.c(breast.data, ncycles=4000, M=5)
breast.c2 <- dirichlet.c(breast.data,ncycles=4000, M=1000)

##  Create list object.

breast.c1c2 <- list("5"=breast.c1$chain, "1000"= breast.c2$chain)

##  Decide on some number of initial runs to omit from the analysis.

draw.post(breast.c1c2, burnin=100) # plots for hyperparameters only

## End(Not run)

bspmma documentation built on May 2, 2019, 6:50 a.m.