bf.o: Compute Bayes Factors for Comparing Values of the Dirichlet...

Description Usage Arguments Details Value References Examples

View source: R/modelfit.R

Description

This function carries out the final step in computing Bayes factors for comparing a sequence of values of the Dirichlet precision parameter M for the ordinary Dirichlet mixing model.

Usage

1
bf.o(df=-99, from=.4, incr=.1, to, cc, mat.list)

Arguments

df

degrees of freedom for the t distribution in the model; df=-99 corresponds to a normal distribution.

from

is the starting value for the sequence of values of the precision parameter M at which to compute the Bayes factor.

incr

is the amount by which to increment the values of M.

to

is the ending value for the sequence of values of M.

cc

is the vector of nine constants computed by bf1 and bf2 prior to this step in the algorithm.

mat.list

list of nine matrices of MCMC output produced by bf1 for the final computation of the Bayes factors.

Details

This function carries out the fourth and final step in the computation of Bayes factors for the selection of M in the ordinary Dirichlet mixing model. In the current version of the package, the Bayes factors for M are computed relative to the model with M=4. The sequence of steps implements a multiple-chain version of Equation (2.7) of Burr (2012); the details of the multiple-chain algorithm are given in Doss (2012). Previous steps are calls to bf1, bf2, and bf1 again, in that order, as illustrated in the Examples section and in Burr (2012).

Value

A list with three named components, Mnew, y, and yinfinity, needed to produce the plot of Bayes factors via the function draw.bf. The vector Mnew is the sequence of (finite) values of M. The vector y is the estimates of the Bayes factors corresponding to the finite values of Mnew, and the object yinfinity is the value of the Bayes factor for M at infinity, that is, for the parametric model.

References

Burr, Deborah (2012). “bspmma: An R package for Bayesian semi-parametric models for meta-analysis.” Journal of Statistical Software 50(4), 1–23. http://www.jstatsoft.org/v50/i04/.

Doss, Hani (2012). “Hyperparameter and model selection for nonparametric Bayes problems via Radon-Nikodym derivatives.” Statistica Sinica 22, 1–26.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
##  CPU times are from runs of the R command system.time() on an
##  Intel $2.8$ GHz Q$9550$ running Linux.
## Preliminary steps

data(breast.17) # the breast cancer dataset
breast.data <- as.matrix(breast.17) # put data in matrix object
chain1.list <- bf1(breast.data) # 40.5 secs
cc <- bf2(chain1.list) # 1.6 secs
## Next get a second set of 9 chains, with a different seed
chain2.list <- bf1(breast.data,seed=2) # 40.4 secs

## Compute and plot the Bayes factors
breast.bfo <- bf.o(to=20, cc=cc, mat.list=chain2.list) #51 secs
draw.bf(breast.bfo)

## End(Not run)

bspmma documentation built on Jan. 14, 2019, 1:04 a.m.