randomeff: Gibbs sampler for a one-way random effect model

Description Usage Arguments Value Author(s) References Examples

View source: R/randomeff.R

Description

This function describes a Gibbs sampler for the one-way random effect model for the Energy dataset provided with the mcsm package. The prior is made of conjugate distributions, i.e. normal and inverted gamma distributions.

Usage

1
randomeff(nsim = 10^3, a = 10, b = 30)

Arguments

nsim

Number of Gibbs iterations

a

Common shape parameter for the inverted variances

b

Common scale parameter for the inverted variances

Value

This function produces a plot made of six histograms corresponding to the six parameters of the model mu, theta1, theta2, sqrt(sigma2mu), sqrt(tau2), and sqrt(sigma2), eliminating the first $10%$ of the simulations as burnin.

Author(s)

Christian P. Robert and George Casella

References

Chapter 7 of EnteR Monte Carlo Statistical Methods

Examples

1
2
data(Energy)
randomeff(10^4,a=1,b=1)

Example output

Loading required package: MASS
Loading required package: coda

mcsm documentation built on May 2, 2019, 10:16 a.m.

Related to randomeff in mcsm...