bf.c {bspmma} | R Documentation |
Compute Bayes Factors for Comparing Values of the Dirichlet Precision Parameter in the Conditional Dirichlet Model
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 conditional Dirichlet mixing model.
Usage
bf.c(df=-99, from=.4, incr=.1, to, cc, mat.list)
Arguments
df |
degrees of freedom for the |
from |
is the starting value for the sequence of values of
the precision parameter |
incr |
is the amount by which to increment the values
of |
to |
is the ending value for the sequence of values
of |
cc |
is the vector of nine constants computed by |
mat.list |
list of nine matrices of MCMC output produced by
|
Details
This function carries out the fourth and final step in the computation
of Bayes factors for the selection of M
in the conditional
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.6) of Burr (2012); the details
of the multiple-chain algorithm are given in Doss (2012).
Previous steps are two calls to bf1
and a call to bf2
,
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 semiparametric 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
## 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.bfc <- bf.c(to=20, cc=cc, mat.list=chain2.list)
draw.bf(breast.bfc)
## End(Not run)