Description Usage Arguments Value
After generating a model using make_BayesCMR, this function will sample the posterior. Default settings work relatively well for smaller models, but output needs to be checked for convergence (and more iterations are often necessary for models with many parameters). The sampler uses a covariance scaling to achieve good mixing. First half of the iterations are burning, and continually the proposals widths are tuned. The covariance structure of the samples in this burnin phase is used for proposals in the latter half.
1 2 3 4 5 6 7 8 9 10 11 |
cmrModel |
is a |
niter |
is number of iterations. Defaults to |
nthin |
sets the thinning, i.e. samples for each |
vmin |
sets the minimum and initial standard deviation of the normal proposals. |
draweps |
number of iterations between each update of the proposal covariance matrix. Defaults to |
cvstp |
Covariance structure for proposal. This is tuned during burnin phase. Defaults to (2.38/(sqrt(cmrModel$npar)))^2*diag(vmin,cmrModel$npar)) |
adapt |
Adapt the covariance proposals during first half? |
x_init |
Potential initial values for the chain. If not provided the initial mean rates are optimized using the probability density function and all other parameters set to 0. |
A CMR_fit
structure with $Chain
for samples, $Probs
for posterior probabilities, $Accept
with number of accepted proposals in each block, $Model
is the CMR_model
supplied as input, $Covs
is the proposal covariance structure used in the last half of the chain.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.