bf1 function

Generate Chains for Computation of Bayes Factors

Generate Chains for Computation of Bayes Factors

Generate nine matrices of MCMC output under the ordinary Dirichlet model, for nine fixed values of the precision parameter MM. This MCMC output is needed for computing Bayes factors.

bf1(data,seed=1,ncycles=2000,d=c(.1,.1,0,1000),K=10,burnin=1000)

Arguments

  • data: is a two-column matrix with a row for each study in the meta-analysis. The first column is the log of estimate of relative risk, often a log(odds ratio). The second column is the true or estimated standard error of the log(odds ratio).
  • seed: is the value of the seed for starting the random number generator, which will be used before each of the nine calls to the function dirichlet.o.
  • ncycles: is the number of cycles of the Markov chain.
  • d: is a vector of length four with the values of the hyperparameters, in order, the location and scale of the Gamma inverse prior, mean and variance multiplier for the normal prior on mumu.
  • K: is the number of summands to include when one uses Sethuraman's (1994) representation for getting the parameter eta=eta = mean(FF). If you do not intend to use this parameter, then take KK small, say K=10K=10.
  • burnin: is the number of Markov chain cycles to drop.

Details

Doss (2012) describes a method for estimating Bayes factors for many MM values in a Dirichlet mixing model; the method requires judicious selection of multiple hyperparameter points at which to estimate the posterior distribution by MCMC under the ordinary Dirichlet model. The function bf1 is used for estimating Bayes factors for conditional vs.\ ordinary Dirichlet models, and for comparing values of MM in the conditional model or in the ordinary model, for a range of the precision parameter MM which cover the range of values of interest in most practical problems. The function bf1 generates the MCMC output for a hard-wired selection of hyperparameters which work well to give low-variance estimates of Bayes factors of interest in practice. Chains are generated for nine values of the Dirichlet precision parameter MM: .25,.5,1,2,4,8,16,32.25, .5, 1, 2, 4, 8, 16, 32, and 6464. The rest of the Dirichlet model is specified by the parameters of the normal/inverse Gamma prior, which by default are d=(.1,.1,0,1000)d = (.1,.1,0,1000).

Returns

List with nine matrix components. Each matrix has nrnr rows and ncnc columns, where nr=nr= ncycles - burnin, nc=nc= (number of studies) +4+4 for the row label, the individual study parameter values, and the three overall parameters, mumu, tautau, and etaeta.

References

Doss, Hani (2012). Hyperparameter and model selection for nonparametric Bayes problems viaRadon-Nikodym derivatives.

Statistica Sinica, 22, 1--26.

Sethuraman, J. (1994). A constructive definition of Dirichlet priors. Statistica Sinica 4, 639--650.

Examples

## Not run: ## Set up the data. data(breast.17) # the breast cancer dataset breast.data <- as.matrix(breast.17) # put data in matrix object ## Default values ncycles=2000, burnin=1000, seed=1 ## CPU time is given from a run of the R command system.time() on an ## Intel $2.8$ GHz Q$9550$ running Linux chain1.list <- bf1(breast.data) # 40.5 secs ## Next get a second set of 9 chains, with a different seed chain2.list <- bf2(breast.data, seed=2) # 40.4 secs ## Perhaps save for another time. save(chain1.list,chain2.list,file="breast-rdat-2lists-1000",compress=TRUE) ## later session load("breast-rdat-2lists-1000") ## End(Not run)
  • Maintainer: Deborah Burr
  • License: GPL-2
  • Last published: 2019-01-13

Useful links