Description Usage Arguments Value Author(s) Examples
Implements Gibbs sampling for normal sampling with independent priors on the mean and precision
1 | gibbs_normal(s, P = 0.002, iter = 1000)
|
s |
a list with components y, the observed data, mu0, the prior mean of mu, sigma0, the prior standard deviation of mu, a, the shape parameter of the gamma prior on P, b, the rate parameter of the gamma prior on P |
P |
starting value of the precision parameter |
iter |
number of iterations |
matrix of simulated draws of (mu, P) from the algorithm
Jim Albert
1 2 3 | s <- list(y = rnorm(20, 5, 2),
mu0 = 10, sigma0 = 3, a = 1, b = 1)
out <- gibbs_normal(s, P = 0.01, iter=100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.