Learn R Programming

mcsm (version 1.0)

gibbsmix: Implementation of a Gibbs sampler on a mixture posterior

Description

This function runs a standard Gibbs sampling algorithm on a posterior distribution associated with a mixture model and 500 datapoints.

Usage

gibbsmix(Niter = 10^4, v = 1)

Arguments

Niter
Number of MCMC iterations
v
Scale of the normal prior

Value

The function returns a plot of the log-posterior surface, along with the MCMC sample represented both by points and lines linking one value to the next. Evaluating the log-posterior surface on a $250x250$ grid takes some time.

References

Chapter 6 of EnteR Monte Carlo Statistical Methods

Examples

Run this code
## Not run: gibbsmix(Nit=10^3)

Run the code above in your browser using DataLab