Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

normal.normal.mix

Computes the posterior for normal sampling and a mixture of normals prior


Description

Computes the parameters and mixing probabilities for a normal sampling problem, variance known, where the prior is a discrete mixture of normal densities.

Usage

normal.normal.mix(probs,normalpar,data)

Arguments

probs

vector of probabilities of the normal components of the prior

normalpar

matrix where each row contains the mean and variance parameters for a normal component of the prior

data

vector of observation and sampling variance

Value

probs

vector of probabilities of the normal components of the posterior

normalpar

matrix where each row contains the mean and variance parameters for a normal component of the posterior

Author(s)

Jim Albert

Examples

probs=c(.5, .5)
normal.par1=c(0,1)
normal.par2=c(2,.5)
normalpar=rbind(normal.par1,normal.par2)
y=1; sigma2=.5
data=c(y,sigma2)
normal.normal.mix(probs,normalpar,data)

LearnBayes

Functions for Learning Bayesian Inference

v2.15.1
GPL (>= 2)
Authors
Jim Albert
Initial release
2018-03-18

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.