Description Usage Arguments Details Value
This function can be used to perform Gibbs sampling using JAGS and the R-package rjags.
1 |
y |
data |
prior |
an optional list of hyperparameters for prior distributions (See details how to define this list). Default is NULL. |
k |
optional value of how many normal components should be modeled. Default is NULL. |
This function is part of the TheBayesteApproach function of the ECOFFBayes package. It can be used to perform Gibbs sampling to sample
the μ's and τ from the posterior distribution. Thereby, the priors of the μ's are assumed to be normal and the
priors of τ's are assumed to be gamma distributions. To account for the binning, y is drawn from a truncated normal distribution.
The data argument must be a flat vector of the binned non-resistant bacteria observations. The prior argument must be a list and specified as
described in the function TheBayesteApproach
. k is an optional parameter indicating the number of normal components. If the argument
k is not defined by the user, the function assumes 20 components. In total 10000 draws are done where only each 10th draw is really taken (thinning = 10).
A burnin period of 1000 iterations is automatically set. Finally, τ is converted to σ^2 and
returned is a matrix of the Gibbs sampling draws with the μ, π, σ^2 and z.
Returns a matrix which contains the Gibbs sampler iterations after thinning and deleting the burnin period. Columns include the estimated normal components parameters, the component probabilities and the classifications z for all observations.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.