Description Usage Arguments Details Value
Similar to dic.fit
but uses MCMC instead of a direct likelihood optimization routine to fit the model. Currently, four distributions are supported: log-normal, gamma, Weibull, and Erlang. See Details for prior specification.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
dat |
the data |
prior.par1 |
vector of first prior parameters for each model parameter. If |
prior.par2 |
vector of second prior parameters for each model parameter. If |
init.pars |
the initial parameter values (vector length = 2 ) |
ptiles |
returned percentiles of the survival survival distribution |
verbose |
how often do you want a print out from MCMCpack on iteration number and M-H acceptance rate |
burnin |
number of burnin samples |
n.samples |
number of samples to draw from the posterior (after the burnin) |
dist |
distribution to be used (L for log-normal,W for weibull, G for Gamma, and E for erlang, off1G for 1 day right shifted gamma) |
seed |
seed for the random number generator for MCMC |
... |
additional parameters to MCMCmetrop1R |
The following models are used:
Log-normal model: f(x) = \frac{1}{x*σ √{2 * π}} exp\{-\frac{(\log x - μ)^2}{2 * σ^2}\}
Log-normal Default Prior: μ ~ N(0, 1000), log(σ) ~ N(0,1000)
Weibull model: f(x) = \frac{α}{β}(\frac{x}{β})^{α-1} exp\{-(\frac{x}{β})^{α}\}
Weibull Default Prior Specification: log(α) ~ N( 0, 1000), β ~ Gamma(0.001,0.001)
Gamma model: f(x) = \frac{1}{θ^k Γ(k)} x^{k-1} exp\{-\frac{x}{θ}\}
Gamma Default Prior Specification: p(k,θ) \propto \frac{1}{θ} * √{k*TriGamma(k)-1}
(Note: this is Jeffery's Prior when both parameters are unknown), and
Trigamma(x) = \frac{\partial}{\partial x^2} ln(Γ(x))
.)
Erlang model: f(x) = \frac{1}{θ^k (k-1)!} x^{k-1} exp\{-\frac{x}{θ}\}
Erlang Default Prior Specification: k \sim NBinom(100,1), log(θ) \sim N(0,1000)
(Note: parameters in the negative binomial distribution above represent mean and size, respectively)
a cd.fit.mcmc S4 object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.