gibbsmean {bayess}R Documentation

Gibbs sampler on a mixture posterior distribution with unknown means

Description

This function implements a Gibbs sampler for a toy mixture problem (Chapter 6) with two Gaussian components and only the means unknown, so that likelihood and posterior surfaces can be drawn.

Usage

gibbsmean(p, datha, niter = 10^4)

Arguments

p

first component weight

datha

dataset to be modelled as a mixture

niter

number of Gibbs iterations

Value

Sample of mu's as a matrix of size niter x 2

See Also

plotmix

Examples

dat=plotmix(plottin=FALSE)$sample
simu=gibbsmean(0.7,dat,niter=100)
plot(simu,pch=19,cex=.5,col="sienna",xlab=expression(mu[1]),ylab=expression(mu[2]))

[Package bayess version 1.4 Index]