gibbsmean: Gibbs sampler on a mixture posterior distribution with...

View source: R/gibbsmean.R

gibbsmeanR 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]))

bayess documentation built on Aug. 11, 2022, 5:07 p.m.

Related to gibbsmean in bayess...