The ‘iNZightBayes’ package uses simple Bayesian estimation methods to obtain summaries for some common problems, such as a sample mean or proportion, ANOVA (multiple means), and linear regression.
Grand mean of numeric variable
Here we are calculating the mean and variance of a single numeric variable with length , using a Gibbs sampler. The model is where the prior on is Normal with mean and variance , and the prior on is Inverse-Gamma with parameters and . The likelihood for is Normal with mean and variance .
Since these are conjugate, the full conditionals needed for Gibbs sampling are