Description Usage Arguments Details Value Examples
View source: R/centered_gibbs3.R
Gibbs sampler for centered 3-level Gaussian hierarchical model according to derived full conditionals
1 2 | centered_gibbs3(i, j, k, ndraws, burnin, flat_prior = TRUE, tau = 1,
tau_a = 1, tau_b = 1, tau_c = 1, sigma_2 = 1)
|
i |
number of nodes at level 1 |
j |
number of children nodes in level 2 per node at level 1 |
k |
number of children nodes in level 3 per node at level 2 |
ndraws |
number of samples the user wants to have |
burnin |
number of samples to throw away at the start as the gibbs sampler warms up |
flat_prior |
determines whether to use the density with flat prior |
tau |
variance of the root (level 0) |
tau_a |
variance for parameters in level 1 |
tau_b |
variance for parameters in level 2 |
tau_c |
variance for parameters in level 3 |
sigma_2 |
variance of the observations |
Assumptions: - variances are constant for parameters within the same level - all observations y_ijk are equal to 0 - the mean of the root parameter B is mu = 0 - assume a naive sampler where the variances are not updated
list of means and the samples
1 2 3 4 5 6 | i <- 2
j <- 3
k <- 2
ndraws <- 10000
burnin <- 1000
centered_gibbs3(i = i, j = j, k = k, ndraws = ndraws, burnin = burnin)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.