東京大学 情報理工学系研究科 コンピュータ科学専攻 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 σ 0 2 \sigma_0^2 σ 0 2 :
N ( x ∣ μ , σ 0 2 ) = 1 2 π σ 0 2 exp ( − 1 2 σ 0 2 ( 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). N ( x ∣ μ , σ 0 2 ) = 2 π σ 0 2 1 exp ( − 2 σ 0 2 1 ( x − μ ) 2 ) .
Let us also consider n n n real-valued observations; they are denoted by x 1 : n = ( x 1 , x 2 , … , x n ) x_{1:n}=(x_1,x_2,\ldots,x_n) x 1 : n = ( x 1 , x 2 , … , x n ) . We further suppose the following.
Each observation x i x_i x i (where i = 1 , 2 , … , n i=1,2,\ldots,n i = 1 , 2 , … , n ) is independently distributed, following the one-dimensional normal distribution with mean μ \mu μ and variance σ 0 2 \sigma_0^2 σ 0 2 .
Variance σ 0 2 \sigma_0^2 σ 0 2 is known.
The prior distribution of μ \mu μ is the one-dimensional normal distribution with mean m 0 m_0 m 0 and variance ρ 0 2 \rho_0^2 ρ 0 2 .
Answer the following questions.
(1) Given an observation x 1 x_1 x 1 , let p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 0 2 ) p(\mu\mid x_1,\sigma_0^2,m_0,\rho_0^2) p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 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 ( μ ∣ m 1 , ρ 1 2 ) \mathcal N(\mu\mid m_1,\rho_1^2) N ( μ ∣ m 1 , ρ 1 2 ) . Express mean m 1 m_1 m 1 and variance ρ 1 2 \rho_1^2 ρ 1 2 , using x 1 , σ 0 2 , m 0 x_1,\sigma_0^2,m_0 x 1 , σ 0 2 , m 0 and ρ 0 2 \rho_0^2 ρ 0 2 .
You can use the following equality:
p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 0 2 ) = N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) ∫ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) 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}. p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 0 2 ) = ∫ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) d μ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) .
(2) Let n ≥ 2 n\ge2 n ≥ 2 . Given observations x 1 : n = ( x 1 , x 2 , … , x n ) x_{1:n}=(x_1,x_2,\ldots,x_n) x 1 : n = ( x 1 , x 2 , … , x n ) , let p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 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 ( μ ∣ m n , ρ n 2 ) \mathcal N(\mu\mid m_n,\rho_n^2) N ( μ ∣ m n , ρ n 2 ) . Express mean m n m_n m n and variance ρ n 2 \rho_n^2 ρ n 2 , using n , x 1 : n , σ 0 2 , m 0 n,x_{1:n},\sigma_0^2,m_0 n , x 1 : n , σ 0 2 , m 0 and ρ 0 2 \rho_0^2 ρ 0 2 .
(3) For the Bayes posterior distribution p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) p(\mu\mid x_{1:n},\sigma_0^2,m_0,\rho_0^2) p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) of Question (2), show that the following equality holds:
p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) = N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) ∫ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) 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}. p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) = ∫ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) d μ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) .
题目描述
一维正态分布密度为
N ( x ∣ μ , σ 0 2 ) = 1 2 π σ 0 2 exp [ − ( x − μ ) 2 2 σ 0 2 ] . \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]. N ( x ∣ μ , σ 0 2 ) = 2 π σ 0 2 1 exp [ − 2 σ 0 2 ( x − μ ) 2 ] .
观测 x 1 : n = ( x 1 , … , x n ) x_{1:n}=(x_1,\ldots,x_n) x 1 : n = ( x 1 , … , x n ) 在给定 μ \mu μ 时独立同分布于
N ( μ , σ 0 2 ) \mathcal N(\mu,\sigma_0^2) N ( μ , σ 0 2 ) ,其中 σ 0 2 \sigma_0^2 σ 0 2 已知;先验为
μ ∼ N ( m 0 , ρ 0 2 ) \mu\sim\mathcal N(m_0,\rho_0^2) μ ∼ N ( m 0 , ρ 0 2 ) 。
(1)仅有观测 x 1 x_1 x 1 时,后验为 N ( m 1 , ρ 1 2 ) \mathcal N(m_1,\rho_1^2) N ( m 1 , ρ 1 2 ) 。求 m 1 , ρ 1 2 m_1,\rho_1^2 m 1 , ρ 1 2 。
可使用等式
p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 0 2 ) = N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) ∫ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) 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}. p ( μ ∣ x 1 , σ 0 2 , m 0 , ρ 0 2 ) = ∫ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) d μ N ( x 1 ∣ μ , σ 0 2 ) N ( μ ∣ m 0 , ρ 0 2 ) .
(2)给定 n ≥ 2 n\ge2 n ≥ 2 个观测时,后验为 N ( m n , ρ n 2 ) \mathcal N(m_n,\rho_n^2) N ( m n , ρ n 2 ) 。求 m n , ρ n 2 m_n,\rho_n^2 m n , ρ n 2 。
(3)证明后验可递推写为
p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) = N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) ∫ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) 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}. p ( μ ∣ x 1 : n , σ 0 2 , m 0 , ρ 0 2 ) = ∫ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) d μ N ( x n ∣ μ , σ 0 2 ) N ( μ ∣ m n − 1 , ρ n − 1 2 ) .
Kai
(1)
似然与先验相乘后,关于 μ \mu μ 的指数项为
− 1 2 [ ( x 1 − μ ) 2 σ 0 2 + ( μ − m 0 ) 2 ρ 0 2 ] . -\frac12\left[\frac{(x_1-\mu)^2}{\sigma_0^2}
+\frac{(\mu-m_0)^2}{\rho_0^2}\right]. − 2 1 [ σ 0 2 ( x 1 − μ ) 2 + ρ 0 2 ( μ − m 0 ) 2 ] .
配方得
ρ 1 2 = ( 1 σ 0 2 + 1 ρ 0 2 ) − 1 = σ 0 2 ρ 0 2 σ 0 2 + ρ 0 2 , \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}}, ρ 1 2 = ( σ 0 2 1 + ρ 0 2 1 ) − 1 = σ 0 2 + ρ 0 2 σ 0 2 ρ 0 2 ,
m 1 = ρ 1 2 ( x 1 σ 0 2 + m 0 ρ 0 2 ) = ρ 0 2 x 1 + σ 0 2 m 0 σ 0 2 + ρ 0 2 . \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}}. m 1 = ρ 1 2 ( σ 0 2 x 1 + ρ 0 2 m 0 ) = σ 0 2 + ρ 0 2 ρ 0 2 x 1 + σ 0 2 m 0 .
(2)
独立性给出 n n n 个二次项。合并 μ 2 \mu^2 μ 2 与 μ \mu μ 的系数可得
ρ n 2 = ( n σ 0 2 + 1 ρ 0 2 ) − 1 = σ 0 2 ρ 0 2 n ρ 0 2 + σ 0 2 , \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}}, ρ n 2 = ( σ 0 2 n + ρ 0 2 1 ) − 1 = n ρ 0 2 + σ 0 2 σ 0 2 ρ 0 2 ,
m n = ρ n 2 ( ∑ i = 1 n x i σ 0 2 + m 0 ρ 0 2 ) = ρ 0 2 ∑ i = 1 n x i + σ 0 2 m 0 n ρ 0 2 + σ 0 2 . \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}}. m n = ρ n 2 ( σ 0 2 ∑ i = 1 n x i + ρ 0 2 m 0 ) = n ρ 0 2 + σ 0 2 ρ 0 2 ∑ i = 1 n x i + σ 0 2 m 0 .
(3)
由条件独立性和 Bayes 公式,
p ( μ ∣ x 1 : n ) ∝ p ( x n ∣ μ , x 1 : n − 1 ) p ( μ ∣ x 1 : n − 1 ) = p ( x n ∣ μ ) p ( μ ∣ x 1 : n − 1 ) . \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 ( μ ∣ x 1 : n ) ∝ p ( x n ∣ μ , x 1 : n − 1 ) p ( μ ∣ x 1 : n − 1 ) = p ( x n ∣ μ ) p ( μ ∣ x 1 : n − 1 ) .
其中 p ( x n ∣ μ ) = N ( x n ∣ μ , σ 0 2 ) p(x_n\mid\mu)=\mathcal N(x_n\mid\mu,\sigma_0^2) p ( x n ∣ μ ) = N ( x n ∣ μ , σ 0 2 ) ,而由(2)对 n − 1 n-1 n − 1 的结论,
p ( μ ∣ x 1 : n − 1 ) = N ( μ ∣ m n − 1 , ρ n − 1 2 ) p(\mu\mid x_{1:n-1})=\mathcal N(\mu\mid m_{n-1},\rho_{n-1}^2) p ( μ ∣ x 1 : n − 1 ) = N ( μ ∣ m n − 1 , ρ n − 1 2 ) 。除以对 μ \mu μ 的积分作归一化,即得到题中等式。