東京大学 情報理工学系研究科 コンピュータ科学専攻 2019年8月実施 専門科目II 問題6
Author
祭音Myyura (co-authored with GPT 5.6 SOL)
Description
The probability density function of the normal distribution N ( μ , σ 2 ) N(\mu, \sigma^2) N ( μ , σ 2 ) with mean μ ∈ R \mu \in \mathbb{R} μ ∈ R and variance σ 2 > 0 \sigma^2 > 0 σ 2 > 0 is given by
f ( x ) = 1 2 π σ 2 exp ( − ( x − μ ) 2 2 σ 2 ) . f(x) = \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x - \mu)^2}{2\sigma^2}\right). f ( x ) = 2 π σ 2 1 exp ( − 2 σ 2 ( x − μ ) 2 ) .
Let X X X and Z Z Z be random variables that independently follow N ( μ , 1 ) N(\mu, 1) N ( μ , 1 ) and N ( 0 , 1 ) N(0, 1) N ( 0 , 1 ) , respectively, and define Y = θ X + Z Y = \theta X + Z Y = θX + Z for some constant θ ∈ R \theta \in \mathbb{R} θ ∈ R . For an integer n > 1 n > 1 n > 1 , let ( X 1 , Y 1 ) , ( X 2 , Y 2 ) , … , ( X n , Y n ) (X_1, Y_1), (X_2, Y_2), \ldots, (X_n, Y_n) ( X 1 , Y 1 ) , ( X 2 , Y 2 ) , … , ( X n , Y n ) be two-dimensional random variables that independently follow the same distribution as ( X , Y ) (X, Y) ( X , Y ) , for which we write X ( n ) = ( X 1 , X 2 , … , X n ) X^{(n)} = (X_1, X_2, \ldots, X_n) X ( n ) = ( X 1 , X 2 , … , X n ) and Y ( n ) = ( Y 1 , Y 2 , … , Y n ) Y^{(n)} = (Y_1, Y_2, \ldots, Y_n) Y ( n ) = ( Y 1 , Y 2 , … , Y n ) .
Answer the following questions.
(1) Express the expectation E [ Y ] \mathbb{E}[Y] E [ Y ] and variance V [ Y ] \mathbb{V}[Y] V [ Y ] of Y Y Y using μ \mu μ and θ \theta θ .
(2) Show that the conditional distribution of X X X given Y Y Y is a normal distribution, and express its expectation E [ X ∣ Y ] \mathbb{E}[X|Y] E [ X ∣ Y ] and variance V [ X ∣ Y ] \mathbb{V}[X|Y] V [ X ∣ Y ] using μ \mu μ , θ \theta θ , and Y Y Y .
(3) Let ( x ( n ) , y ( n ) ) (x^{(n)}, y^{(n)}) ( x ( n ) , y ( n ) ) denote a realization of ( X ( n ) , Y ( n ) ) (X^{(n)}, Y^{(n)}) ( X ( n ) , Y ( n ) ) . Express the joint probability density function p μ , θ ( x ( n ) , y ( n ) ) p_{\mu, \theta}(x^{(n)}, y^{(n)}) p μ , θ ( x ( n ) , y ( n ) ) of ( X ( n ) , Y ( n ) ) (X^{(n)}, Y^{(n)}) ( X ( n ) , Y ( n ) ) using μ , θ , x ( n ) = ( x 1 , x 2 , … , x n ) \mu, \theta, x^{(n)} = (x_1, x_2, \ldots, x_n) μ , θ , x ( n ) = ( x 1 , x 2 , … , x n ) and y ( n ) = ( y 1 , y 2 , … , y n ) y^{(n)} = (y_1, y_2, \ldots, y_n) y ( n ) = ( y 1 , y 2 , … , y n ) .
(4) Consider maximum-likelihood estimation of ( μ , θ ) (\mu, \theta) ( μ , θ ) by the EM algorithm for the case where the observation of X n X_n X n is missing from ( X ( n ) , Y ( n ) ) (X^{(n)},Y^{(n)}) ( X ( n ) , Y ( n ) ) , that is, the case where ( X ( n − 1 ) , Y ( n ) ) (X^{(n-1)},Y^{(n)}) ( X ( n − 1 ) , Y ( n ) ) is observed. Then the update rule of estimators of ( μ , θ ) (\mu, \theta) ( μ , θ ) by the EM algorithm for some initial value ( μ 0 , θ 0 ) ∈ R 2 (\mu_0, \theta_0) \in \mathbb{R}^2 ( μ 0 , θ 0 ) ∈ R 2 is given by
( μ t + 1 , θ t + 1 ) = arg max ( μ , θ ) ∈ R 2 E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) ) ] , t = 0 , 1 , … , (\mu_{t+1}, \theta_{t+1}) = \mathop{\arg\max}\limits_{(\mu, \theta) \in \mathbb{R}^2} \mathbb{E}_{X_n \sim N(\bar{\mu}, \bar{\sigma}^2)}[\log p_{\mu, \theta}(X^{(n)},Y^{(n)})], \quad t = 0, 1, \ldots, ( μ t + 1 , θ t + 1 ) = ( μ , θ ) ∈ R 2 arg max E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) )] , t = 0 , 1 , … ,
where μ ˉ \bar{\mu} μ ˉ and σ ˉ 2 \bar{\sigma}^2 σ ˉ 2 are the values obtained by the substitution ( μ , θ , Y ) : = ( μ t , θ t , Y n ) (\mu, \theta, Y) := (\mu_t, \theta_t, Y_n) ( μ , θ , Y ) := ( μ t , θ t , Y n ) in the expressions of E [ X ∣ Y ] \mathbb{E}[X|Y] E [ X ∣ Y ] and V [ X ∣ Y ] \mathbb{V}[X|Y] V [ X ∣ Y ] obtained in question (2), respectively, and E X n ∼ N ( μ ˉ , σ ˉ 2 ) \mathbb{E}_{X_n \sim N(\bar{\mu}, \bar{\sigma}^2)} E X n ∼ N ( μ ˉ , σ ˉ 2 ) denotes the expectation when X n X_n X n follows N ( μ ˉ , σ ˉ 2 ) N(\bar{\mu}, \bar{\sigma}^2) N ( μ ˉ , σ ˉ 2 ) and ( X ( n − 1 ) , Y ( n ) ) (X^{(n-1)},Y^{(n)}) ( X ( n − 1 ) , Y ( n ) ) is fixed.
(i) Express E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) ) ] \mathbb{E}_{X_n \sim N(\bar{\mu}, \bar{\sigma}^2)}[\log p_{\mu, \theta}(X^{(n)},Y^{(n)})] E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) )] using n , μ , θ , μ ˉ , σ ˉ 2 , X ( n − 1 ) n, \mu, \theta, \bar{\mu}, \bar{\sigma}^2, X^{(n-1)} n , μ , θ , μ ˉ , σ ˉ 2 , X ( n − 1 ) and Y ( n ) Y^{(n)} Y ( n ) .
(ii) Express ( μ t + 1 , θ t + 1 ) (\mu_{t+1}, \theta_{t+1}) ( μ t + 1 , θ t + 1 ) using n , μ ˉ , σ ˉ 2 , X ( n − 1 ) n, \bar{\mu}, \bar{\sigma}^2, X^{(n-1)} n , μ ˉ , σ ˉ 2 , X ( n − 1 ) and Y ( n ) Y^{(n)} Y ( n ) .
题目描述
均值为 μ ∈ R \mu\in\mathbb R μ ∈ R 、方差为 σ 2 > 0 \sigma^2>0 σ 2 > 0 的正态分布
N ( μ , σ 2 ) N(\mu,\sigma^2) N ( μ , σ 2 ) 的密度为
f ( x ) = 1 2 π σ 2 exp ( − ( x − μ ) 2 2 σ 2 ) . f(x)=\frac1{\sqrt{2\pi\sigma^2}}
\exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right). f ( x ) = 2 π σ 2 1 exp ( − 2 σ 2 ( x − μ ) 2 ) .
设随机变量 X , Z X,Z X , Z 相互独立,分别服从 N ( μ , 1 ) N(\mu,1) N ( μ , 1 ) 与 N ( 0 , 1 ) N(0,1) N ( 0 , 1 ) ,并令
Y = θ X + Z Y=\theta X+Z Y = θX + Z ,其中 θ ∈ R \theta\in\mathbb R θ ∈ R 。对整数 n > 1 n>1 n > 1 ,令
( X i , Y i ) ( i = 1 , … , n ) (X_i,Y_i)\ (i=1,\ldots,n) ( X i , Y i ) ( i = 1 , … , n ) 独立同分布于 ( X , Y ) (X,Y) ( X , Y ) ,记
X ( n ) = ( X 1 , … , X n ) X^{(n)}=(X_1,\ldots,X_n) X ( n ) = ( X 1 , … , X n ) 、Y ( n ) = ( Y 1 , … , Y n ) Y^{(n)}=(Y_1,\ldots,Y_n) Y ( n ) = ( Y 1 , … , Y n ) 。回答下列问题。
(1)用 μ , θ \mu,\theta μ , θ 表示 E [ Y ] \mathbb E[Y] E [ Y ] 和 V [ Y ] \mathbb V[Y] V [ Y ] 。
(2)证明给定 Y Y Y 时 X X X 的条件分布仍为正态分布,并用
μ , θ , Y \mu,\theta,Y μ , θ , Y 表示 E [ X ∣ Y ] \mathbb E[X\mid Y] E [ X ∣ Y ] 与 V [ X ∣ Y ] \mathbb V[X\mid Y] V [ X ∣ Y ] 。
(3)设 ( x ( n ) , y ( n ) ) (x^{(n)},y^{(n)}) ( x ( n ) , y ( n ) ) 是
( X ( n ) , Y ( n ) ) (X^{(n)},Y^{(n)}) ( X ( n ) , Y ( n ) ) 的一个实现。用
μ , θ , x ( n ) , y ( n ) \mu,\theta,x^{(n)},y^{(n)} μ , θ , x ( n ) , y ( n ) 写出其联合密度
p μ , θ ( x ( n ) , y ( n ) ) p_{\mu,\theta}(x^{(n)},y^{(n)}) p μ , θ ( x ( n ) , y ( n ) ) 。
(4)现在 X n X_n X n 缺失,仅观测到 ( X ( n − 1 ) , Y ( n ) ) (X^{(n-1)},Y^{(n)}) ( X ( n − 1 ) , Y ( n ) ) ,用 EM 算法进行
( μ , θ ) (\mu,\theta) ( μ , θ ) 的最大似然估计。从任意初值 ( μ 0 , θ 0 ) ∈ R 2 (\mu_0,\theta_0)\in\mathbb R^2 ( μ 0 , θ 0 ) ∈ R 2 出发,更新规则为
( μ t + 1 , θ t + 1 ) = arg max ( μ , θ ) ∈ R 2 E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) ) ] , t = 0 , 1 , … , (\mu_{t+1},\theta_{t+1})
=\mathop{\arg\max}_{(\mu,\theta)\in\mathbb R^2}
\mathbb E_{X_n\sim N(\bar\mu,\bar\sigma^2)}
[\log p_{\mu,\theta}(X^{(n)},Y^{(n)})],\qquad t=0,1,\ldots, ( μ t + 1 , θ t + 1 ) = arg max ( μ , θ ) ∈ R 2 E X n ∼ N ( μ ˉ , σ ˉ 2 ) [ log p μ , θ ( X ( n ) , Y ( n ) )] , t = 0 , 1 , … ,
其中 μ ˉ , σ ˉ 2 \bar\mu,\bar\sigma^2 μ ˉ , σ ˉ 2 分别是在第(2)问的条件均值、条件方差表达式中代入
( μ , θ , Y ) = ( μ t , θ t , Y n ) (\mu,\theta,Y)=(\mu_t,\theta_t,Y_n) ( μ , θ , Y ) = ( μ t , θ t , Y n ) 所得;取期望时固定
( X ( n − 1 ) , Y ( n ) ) (X^{(n-1)},Y^{(n)}) ( X ( n − 1 ) , Y ( n ) ) 。
(i)用 n , μ , θ , μ ˉ , σ ˉ 2 , X ( n − 1 ) , Y ( n ) n,\mu,\theta,\bar\mu,\bar\sigma^2,X^{(n-1)},Y^{(n)} n , μ , θ , μ ˉ , σ ˉ 2 , X ( n − 1 ) , Y ( n )
表示上述期望对数似然。
(ii)用 n , μ ˉ , σ ˉ 2 , X ( n − 1 ) , Y ( n ) n,\bar\mu,\bar\sigma^2,X^{(n-1)},Y^{(n)} n , μ ˉ , σ ˉ 2 , X ( n − 1 ) , Y ( n )
表示更新后的 ( μ t + 1 , θ t + 1 ) (\mu_{t+1},\theta_{t+1}) ( μ t + 1 , θ t + 1 ) 。
Kai
(1)
由 X , Z X,Z X , Z 独立,
E [ Y ] = θ μ , V [ Y ] = 1 + θ 2 . \boxed{\mathbb E[Y]=\theta\mu,\qquad\mathbb V[Y]=1+\theta^2.} E [ Y ] = θ μ , V [ Y ] = 1 + θ 2 .
(2)
固定 Y = y Y=y Y = y ,联合密度中与 x x x 有关的指数为
− 1 2 [ ( x − μ ) 2 + ( y − θ x ) 2 ] = − 1 + θ 2 2 ( x − μ + θ y 1 + θ 2 ) 2 + C ( y ) . -\frac12\big[(x-\mu)^2+(y-\theta x)^2\big]
=-\frac{1+\theta^2}{2}
\left(x-\frac{\mu+\theta y}{1+\theta^2}\right)^2+C(y). − 2 1 [ ( x − μ ) 2 + ( y − θ x ) 2 ] = − 2 1 + θ 2 ( x − 1 + θ 2 μ + θ y ) 2 + C ( y ) .
归一化后可知
X ∣ Y = y ∼ N ( μ + θ y 1 + θ 2 , 1 1 + θ 2 ) . \boxed{X\mid Y=y\sim N\left(\frac{\mu+\theta y}{1+\theta^2},\frac1{1+\theta^2}\right).} X ∣ Y = y ∼ N ( 1 + θ 2 μ + θ y , 1 + θ 2 1 ) .
因此条件均值为 ( μ + θ Y ) / ( 1 + θ 2 ) (\mu+\theta Y)/(1+\theta^2) ( μ + θ Y ) / ( 1 + θ 2 ) ,条件方差为 1 / ( 1 + θ 2 ) 1/(1+\theta^2) 1/ ( 1 + θ 2 ) 。
(3)
X i ∼ N ( μ , 1 ) X_i\sim N(\mu,1) X i ∼ N ( μ , 1 ) ,且 Y i ∣ X i = x i ∼ N ( θ x i , 1 ) Y_i\mid X_i=x_i\sim N(\theta x_i,1) Y i ∣ X i = x i ∼ N ( θ x i , 1 ) 。各样本独立,故
p μ , θ ( x ( n ) , y ( n ) ) = ( 2 π ) − n exp { − 1 2 ∑ i = 1 n [ ( x i − μ ) 2 + ( y i − θ x i ) 2 ] } . \boxed{p_{\mu,\theta}(x^{(n)},y^{(n)})
=(2\pi)^{-n}\exp\left\{-\frac12\sum_{i=1}^n
\big[(x_i-\mu)^2+(y_i-\theta x_i)^2\big]\right\}.} p μ , θ ( x ( n ) , y ( n ) ) = ( 2 π ) − n exp { − 2 1 i = 1 ∑ n [ ( x i − μ ) 2 + ( y i − θ x i ) 2 ] } .
(4)
令
μ ˉ = μ t + θ t Y n 1 + θ t 2 , σ ˉ 2 = 1 1 + θ t 2 . \bar\mu=\frac{\mu_t+\theta_tY_n}{1+\theta_t^2},\qquad
\bar\sigma^2=\frac1{1+\theta_t^2}. μ ˉ = 1 + θ t 2 μ t + θ t Y n , σ ˉ 2 = 1 + θ t 2 1 .
(i) 利用 E [ X n ] = μ ˉ \mathbb E[X_n]=\bar\mu E [ X n ] = μ ˉ 、E [ X n 2 ] = μ ˉ 2 + σ ˉ 2 \mathbb E[X_n^2]=\bar\mu^2+\bar\sigma^2 E [ X n 2 ] = μ ˉ 2 + σ ˉ 2 ,有
Q ( μ , θ ) = − n log ( 2 π ) − 1 2 { ∑ i = 1 n − 1 [ ( X i − μ ) 2 + ( Y i − θ X i ) 2 ] + ( μ ˉ − μ ) 2 + σ ˉ 2 + ( Y n − θ μ ˉ ) 2 + θ 2 σ ˉ 2 } . \begin{aligned}
Q(\mu,\theta)
={}&-n\log(2\pi)\\
&-\frac12\left\{
\sum_{i=1}^{n-1}\big[(X_i-\mu)^2+(Y_i-\theta X_i)^2\big]
+(\bar\mu-\mu)^2+\bar\sigma^2
+(Y_n-\theta\bar\mu)^2+\theta^2\bar\sigma^2
\right\}.
\end{aligned} Q ( μ , θ ) = − n log ( 2 π ) − 2 1 { i = 1 ∑ n − 1 [ ( X i − μ ) 2 + ( Y i − θ X i ) 2 ] + ( μ ˉ − μ ) 2 + σ ˉ 2 + ( Y n − θ μ ˉ ) 2 + θ 2 σ ˉ 2 } .
(ii) 分别令对 μ , θ \mu,\theta μ , θ 的偏导为零,得
μ t + 1 = ∑ i = 1 n − 1 X i + μ ˉ n , θ t + 1 = ∑ i = 1 n − 1 X i Y i + μ ˉ Y n ∑ i = 1 n − 1 X i 2 + μ ˉ 2 + σ ˉ 2 . \boxed{\mu_{t+1}=\frac{\sum_{i=1}^{n-1}X_i+\bar\mu}{n},\qquad
\theta_{t+1}=\frac{\sum_{i=1}^{n-1}X_iY_i+\bar\mu Y_n}
{\sum_{i=1}^{n-1}X_i^2+\bar\mu^2+\bar\sigma^2}.} μ t + 1 = n ∑ i = 1 n − 1 X i + μ ˉ , θ t + 1 = ∑ i = 1 n − 1 X i 2 + μ ˉ 2 + σ ˉ 2 ∑ i = 1 n − 1 X i Y i + μ ˉ Y n .
Q Q Q 的 Hessian 为对角矩阵,对角元分别为 − n -n − n 和
− ( ∑ i = 1 n − 1 X i 2 + μ ˉ 2 + σ ˉ 2 ) -(\sum_{i=1}^{n-1}X_i^2+\bar\mu^2+\bar\sigma^2) − ( ∑ i = 1 n − 1 X i 2 + μ ˉ 2 + σ ˉ 2 ) ,均严格为负,因此以上是唯一最大值点。