Two parameter model

Centered on normal distribution

Background knowledge about Distribution

ηΓ1(α,β)p(ηα,β)=βαΓ(α)(1η)α+1eβηMean:  βα1,Var:  β2(α1)2(α2)\eta \sim \Gamma^{-1}(\alpha,\beta) \\ p(\eta|\alpha,\beta)=\frac{\beta^\alpha}{\Gamma(\alpha)}(\frac{1}{\eta})^{\alpha+1}e^{-\frac{\beta}{\eta}} \\ Mean: \; \frac{\beta}{\alpha-1}, Var: \; \frac{\beta^2}{(\alpha-1)^2(\alpha-2)}
θχ2(ν)Γ(ν/2,1/2)θχ2(ν,τ2)Γ1(ν/2,ντ2/2)\theta \sim \chi^2(\nu)\equiv \Gamma(\nu/2,1/2)\\ \theta \sim \chi^{-2}(\nu,\tau^2) \equiv \Gamma^{-1}(\nu/2,\nu\tau^2/2)

One parameter

Normal model with known mean

yσ2N(μ,σ2)σ2χ2(ν0,σ02)σ2yχ2(νn,σn2)y|\sigma^2 \sim N(\mu, \sigma^2) \\ \sigma^2 \sim \chi^{-2}(\nu_0, \sigma^2_0) \\ \sigma^2|y \sim \chi^{-2}(\nu_n,\sigma^2_n)
νn=ν0+nσn2=ν0σ02+ns(y)ν0+nf(yσ2)=h(y)c(σ2)exp(σ2s(y))\nu_n=\nu_0+n \\ \sigma^2_n = \frac{\nu_0\sigma^2_0+ns(y)}{\nu_0+n} \\ f(y|\sigma^2)=h(y)c(\sigma^2)exp(\sigma^2 s(y))

Two parameter

Normal data with a conjugate prior

p(yμ,σ2)σnexp(12σ2Σ(yiμ)2)p(μ,σ2)=p(μσ2)p(σ2)σ1(σ2)(ν02+1)exp[12σ2(ν0σ02+κ0(μ0μ)2)]Ninvχ2(μ0,σ02/κ0;ν0,σ02)μσ2N(μ0,σ2/κ0)σ2χ2(ν0,σ02)p(y|\mu,\sigma^2) \propto \sigma^{-n}exp(-\frac{1}{2\sigma^2}\Sigma(y_i-\mu)^2) \\ p(\mu, \sigma^2)=p(\mu|\sigma^2)p(\sigma^2) \propto \sigma^{-1}(\sigma^2)^{-(\frac{\nu_0}{2}+1)}exp[-\frac{1}{2\sigma^2}(\nu_0\sigma^2_0+\kappa_0(\mu_0-\mu)^2)] \\ Ninv\chi^2(\mu_0,\sigma^2_0/\kappa_0;\nu_0,\sigma^2_0) \\ \mu|\sigma^2 \sim N(\mu_0, \sigma^2/\kappa_0) \\ \sigma^2 \sim \chi^{-2}(\nu_0,\sigma^2_0)
p(μ,σ2y)Ninvχ2(μn,σn2κn;νn,σn2)μn=κ0κ0+nμ0+nκ0+nyˉκn=κ0+nνn=ν0+np(\mu,\sigma^2|y) \sim Ninv\chi^2(\mu_n,\frac{\sigma^2_n}{\kappa_n};\nu_n,\sigma^2_n) \\ \mu_n=\frac{\kappa_0}{\kappa_0+n}\mu_0+\frac{n}{\kappa_0+n}\bar{y} \\ \kappa_n=\kappa_0+n \\ \nu_n=\nu_0+n

Example

(a) Give your posterior distribution for θ\theta

yθN(θ,202)θN(180,402)θyN(μ,τn2)τn2=11/τ02+n/σ2=11/1600+n/400=16001+4nμn=τn2(1τ02μ0+nσ2yˉ)=180+600n1+4ny|\theta \sim N(\theta, 20^2) \\ \theta \sim N(180, 40^2) \\ \theta|y \sim N(\mu, \tau_n^2) \\ \tau_n^2=\frac{1}{1/\tau_0^2 + n/\sigma^2}=\frac{1}{1/1600+n/400}=\frac{1600}{1+4n} \\ \mu_n=\tau_n^2(\frac{1}{\tau^2_0}\mu_0+\frac{n}{\sigma^2}\bar{y})=\frac{180+600n}{1+4n}

(b) Give a posterior predictive distribution for y~\tilde{y}

E(y~y)=E(E(y~μ)y)=E(μy)=μnV(y~y)=E(V(y~μ)y)+V(E(y~μ)y)=σ2+τn2E(\tilde{y}|y)=E(E(\tilde{y}|\mu)|y)=E(\mu|y)=\mu_n \\ V(\tilde{y}|y)=E(V(\tilde{y}|\mu)|y)+V(E(\tilde{y}|\mu)|y)=\sigma^2 + \tau^2_n
y~yN(μn,400+τn2)\tilde{y}|y \sim N(\mu_n, 400+\tau^2_n)

(c) 95% posterior interval for θ\theta and posterior predictive interval for y~\tilde{y}(n=10)

95% posterior interval for θy\theta|y

(μn1.96τn10,μ+1.96τn10)θyN(μn,τn2)(\mu_n-1.96\frac{\tau_n}{\sqrt{10}},\mu+1.96\frac{\tau_n}{\sqrt{10}}) \\ \because \theta|y \sim N(\mu_n,\tau^2_n)

In the same way, we can also get posterior predictive interval with the distribution in (b)

(d) Do the same for n=100

Last updated