bf.o {bspmma} | R Documentation |
Compute Bayes Factors for Comparing Values of the Dirichlet Precision Parameter in the Ordinary 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
for the ordinary Dirichlet mixing model.
Usage
bf.o(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 in the ordinary
Dirichlet mixing model. In the current version of the package, the
Bayes factors for
are computed relative to
the model with
. 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 . 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
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
## 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)