跳到主要内容

東京大学 情報理工学系研究科 コンピュータ科学専攻 2016年8月実施 専門科目II 問題5

Author

祭音Myyura (co-authored with GPT 5.6 SOL)

Description

Consider the probability density function of the one-dimensional normal distribution with mean μ\mu and variance σ02\sigma_0^2:

N(xμ,σ02)=12πσ02exp(12σ02(xμ)2).\mathcal N(x\mid\mu,\sigma_0^2) =\frac{1}{\sqrt{2\pi\sigma_0^2}}\exp\left(-\frac{1}{2\sigma_0^2}(x-\mu)^2\right).

Let us also consider nn real-valued observations; they are denoted by x1:n=(x1,x2,,xn)x_{1:n}=(x_1,x_2,\ldots,x_n). We further suppose the following.

  • Each observation xix_i (where i=1,2,,ni=1,2,\ldots,n) is independently distributed, following the one-dimensional normal distribution with mean μ\mu and variance σ02\sigma_0^2.
  • Variance σ02\sigma_0^2 is known.
  • The prior distribution of μ\mu is the one-dimensional normal distribution with mean m0m_0 and variance ρ02\rho_0^2.

Answer the following questions.

(1) Given an observation x1x_1, let p(μx1,σ02,m0,ρ02)p(\mu\mid x_1,\sigma_0^2,m_0,\rho_0^2) denote the probability density function of the Bayes posterior distribution of the random variable μ\mu. This distribution is a one-dimensional normal distribution, and its probability density function is given by N(μm1,ρ12)\mathcal N(\mu\mid m_1,\rho_1^2). Express mean m1m_1 and variance ρ12\rho_1^2, using x1,σ02,m0x_1,\sigma_0^2,m_0 and ρ02\rho_0^2.

You can use the following equality:

p(μx1,σ02,m0,ρ02)=N(x1μ,σ02)N(μm0,ρ02)N(x1μ,σ02)N(μm0,ρ02)dμ.p(\mu\mid x_1,\sigma_0^2,m_0,\rho_0^2) =\frac{\mathcal N(x_1\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_0,\rho_0^2)} {\int\mathcal N(x_1\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_0,\rho_0^2)\,d\mu}.

(2) Let n2n\ge2. Given observations x1:n=(x1,x2,,xn)x_{1:n}=(x_1,x_2,\ldots,x_n), let p(μx1:n,σ02,m0,ρ02)p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) denote the probability density function of the Bayes posterior distribution of the random variable μ\mu. This distribution is a one-dimensional normal distribution, and its probability density function is given by N(μmn,ρn2)\mathcal N(\mu\mid m_n,\rho_n^2). Express mean mnm_n and variance ρn2\rho_n^2, using n,x1:n,σ02,m0n,x_{1:n},\sigma_0^2,m_0 and ρ02\rho_0^2.

(3) For the Bayes posterior distribution p(μx1:n,σ02,m0,ρ02)p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) of Question (2), show that the following equality holds:

p(μx1:n,σ02,m0,ρ02)=N(xnμ,σ02)N(μmn1,ρn12)N(xnμ,σ02)N(μmn1,ρn12)dμ.p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) =\frac{\mathcal N(x_n\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2)} {\int\mathcal N(x_n\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2)\,d\mu}.

题目描述

一维正态分布密度为

N(xμ,σ02)=12πσ02exp[(xμ)22σ02].\mathcal N(x\mid\mu,\sigma_0^2)=\frac1{\sqrt{2\pi\sigma_0^2}} \exp\left[-\frac{(x-\mu)^2}{2\sigma_0^2}\right].

观测 x1:n=(x1,,xn)x_{1:n}=(x_1,\ldots,x_n) 在给定 μ\mu 时独立同分布于 N(μ,σ02)\mathcal N(\mu,\sigma_0^2),其中 σ02\sigma_0^2 已知;先验为 μN(m0,ρ02)\mu\sim\mathcal N(m_0,\rho_0^2)

(1)仅有观测 x1x_1 时,后验为 N(m1,ρ12)\mathcal N(m_1,\rho_1^2)。求 m1,ρ12m_1,\rho_1^2

可使用等式

p(μx1,σ02,m0,ρ02)=N(x1μ,σ02)N(μm0,ρ02)N(x1μ,σ02)N(μm0,ρ02)dμ.p(\mu\mid x_1,\sigma_0^2,m_0,\rho_0^2) =\frac{\mathcal N(x_1\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_0,\rho_0^2)} {\int\mathcal N(x_1\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_0,\rho_0^2)\,d\mu}.

(2)给定 n2n\ge2 个观测时,后验为 N(mn,ρn2)\mathcal N(m_n,\rho_n^2)。求 mn,ρn2m_n,\rho_n^2

(3)证明后验可递推写为

p(μx1:n,σ02,m0,ρ02)=N(xnμ,σ02)N(μmn1,ρn12)N(xnμ,σ02)N(μmn1,ρn12)dμ.p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) =\frac{\mathcal N(x_n\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2)} {\int\mathcal N(x_n\mid\mu,\sigma_0^2)\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2)\,d\mu}.

Kai

(1)

似然与先验相乘后,关于 μ\mu 的指数项为

12[(x1μ)2σ02+(μm0)2ρ02].-\frac12\left[\frac{(x_1-\mu)^2}{\sigma_0^2} +\frac{(\mu-m_0)^2}{\rho_0^2}\right].

配方得

ρ12=(1σ02+1ρ02)1=σ02ρ02σ02+ρ02,\boxed{\rho_1^2=\left(\frac1{\sigma_0^2}+\frac1{\rho_0^2}\right)^{-1} =\frac{\sigma_0^2\rho_0^2}{\sigma_0^2+\rho_0^2}},
m1=ρ12(x1σ02+m0ρ02)=ρ02x1+σ02m0σ02+ρ02.\boxed{m_1=\rho_1^2\left(\frac{x_1}{\sigma_0^2}+\frac{m_0}{\rho_0^2}\right) =\frac{\rho_0^2x_1+\sigma_0^2m_0}{\sigma_0^2+\rho_0^2}}.

(2)

独立性给出 nn 个二次项。合并 μ2\mu^2μ\mu 的系数可得

ρn2=(nσ02+1ρ02)1=σ02ρ02nρ02+σ02,\boxed{\rho_n^2=\left(\frac n{\sigma_0^2}+\frac1{\rho_0^2}\right)^{-1} =\frac{\sigma_0^2\rho_0^2}{n\rho_0^2+\sigma_0^2}},
mn=ρn2(i=1nxiσ02+m0ρ02)=ρ02i=1nxi+σ02m0nρ02+σ02.\boxed{m_n=\rho_n^2\left(\frac{\sum_{i=1}^n x_i}{\sigma_0^2}+\frac{m_0}{\rho_0^2}\right) =\frac{\rho_0^2\sum_{i=1}^n x_i+\sigma_0^2m_0}{n\rho_0^2+\sigma_0^2}}.

(3)

由条件独立性和 Bayes 公式,

p(μx1:n)p(xnμ,x1:n1)p(μx1:n1)=p(xnμ)p(μx1:n1).\begin{aligned} p(\mu\mid x_{1:n}) &\propto p(x_n\mid\mu,x_{1:n-1})p(\mu\mid x_{1:n-1})\\ &=p(x_n\mid\mu)p(\mu\mid x_{1:n-1}). \end{aligned}

其中 p(xnμ)=N(xnμ,σ02)p(x_n\mid\mu)=\mathcal N(x_n\mid\mu,\sigma_0^2),而由(2)对 n1n-1 的结论, p(μx1:n1)=N(μmn1,ρn12)p(\mu\mid x_{1:n-1})=\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2)。除以对 μ\mu 的积分作归一化,即得到题中等式。