跳到主要内容

京都大学 情報学研究科 知能情報学専攻 2021年7月実施 専門科目 S-3

Author​

祭音Myyura

Description​

大学公表の原題 2次元実数空間におけるデータ点 (x,y)(x, y) が、確率密度関数 f(x,y)f(x, y) をもつ確率分布に従うとする。 この確率分布は、クラス AA と BB に対応する2つの確率分布の混合分布であり、それぞれが以下の確率密度関数をもつ:

fA(x,y)=1πexp⁡(−x2a−ay2), fB(x,y)=1πexp⁡(−(x−2)2−(y−3)2).f_A(x, y) = \frac{1}{\pi} \exp\left(-\frac{x^2}{a} - ay^2\right), \ f_B(x, y) = \frac{1}{\pi} \exp\left(-(x-2)^2 - (y-3)^2\right).

また、クラス AA, BB の事前確率(混合重み) pA,pBp_A, p_B は、それぞれ

pA=11+exp⁡(b),pB=1−pAp_A = \frac{1}{1 + \exp(b)}, \quad p_B = 1 - p_A

とする。なお、aa は正の実数定数、bb は実数定数とする。

設問1 クラス AA に属することが予め分かっている3つのデータ点 (1,1),(2,2),(0,1)(1,1), (2,2), (0,1) が与えられたときの、aa の最尤推定値を求めよ。

設問2 a=1a = 1 とする。あるデータ点 (x,y)(x, y) がクラス AA と BB のいずれに属するかを、クラスの事後確率の大小を比較することで判定する。データ点 (x,y)(x, y) がクラス AA に属すると判定する条件を与えよ。

設問3 データ点 (1,1)(1,1) がクラス AA に属する事後確率が、クラス AA の事前確率と一致する時の aa の値を求めよ。

設問4 a=0.5a = 0.5 とする。2つのデータ点 (0,0),(1,2)(0,0), (1,2) が観測されたときの、bb の最尤推定値を求めよ。なお、exp⁡(−10)≈0\exp(-10) \approx 0 としてよい。

题目描述​

二维数据 (x,y)(x,y) 来自类 A、B 的混合分布:

fA(x,y)=1πe−x2/a−ay2,fB(x,y)=1πe−(x−2)2−(y−3)2,f_A(x,y)=\frac1\pi e^{-x^2/a-ay^2},\qquad f_B(x,y)=\frac1\pi e^{-(x-2)^2-(y-3)^2},

先验概率

pA=11+eb,pB=1−pA,p_A=\frac1{1+e^b},\qquad p_B=1-p_A,

其中 a>0a>0、b∈Rb\in\mathbb R。

  1. 已知 (1,1),(2,2),(0,1)(1,1),(2,2),(0,1) 均属于 A,求 aa 的最大似然估计。
  2. 令 a=1a=1。按 A、B 后验概率大小分类,给出 (x,y)(x,y) 被判为 A 的条件。
  3. 当点 (1,1)(1,1) 属于 A 的后验概率恰等于 A 的先验概率时,求 aa。
  4. 令 a=0.5a=0.5。观察到两个未标注点 (0,0),(1,2)(0,0),(1,2),求 bb 的最大似然估计;可取 e−10≈0e^{-10}\approx0。

Kai​

設問1​

Since the three data points are known to belong to class AA, their log-likelihood is

L(a)=ln⁡∏i=1nfA(xi,yi)=−nln⁡π−1a∑i=1nxi2−a∑i=1nyi2\begin{aligned} L(a) &= \ln \prod_{i=1}^{n}f_{A}(x_{i},y_{i}) = -n\ln \pi -\frac{1}{a}\sum_{i=1}^{n}x_{i}^{2}-a\sum_{i=1}^{n}y_{i}^{2}\\ \end{aligned}

Then,

∂L(a)∂a=1a2∑i=1nxi2−∑i=1nyi2=0⇒a=∑i=1nxi2∑i=1nyi2\frac{\partial L(a)}{\partial a} = \frac{1}{a^{2}}\sum_{i=1}^{n}x_{i}^{2}-\sum_{i=1}^{n}y_{i}^{2} = 0 \Rightarrow a = \sqrt{\frac{\sum_{i=1}^{n}x_{i}^{2}}{\sum_{i=1}^{n}y_{i}^{2}}}

Since ∂2L/∂a2=−2∑ixi2/a3<0\partial^2L/\partial a^2=-2\sum_i x_i^2/a^3<0 for a>0a>0, this stationary point is the maximum.

Therefore, the maximum likelihood estimate of aa is

a=12+22+0212+22+12=306a = \sqrt{\frac{1^{2}+2^{2}+0^{2}}{1^{2}+2^{2}+1^{2}}} = \frac{\sqrt{30}}{6}

設問2​

Let fA′(x,y)f'_A(x,y) and fB′(x,y)f'_B(x,y) denote the posterior class probabilities of a data point (x,y)(x,y) belongs to AA and BB, resp. Let P(x,y)P(x,y) denote the joint probability density function of xx and yy. From the Bayes' theorem, we have

fA′(x,y)=fA(x,y)pAP(x,y)fB′(x,y)=fB(x,y)pBP(x,y)\begin{aligned} f'_A(x,y) &= \frac{f_A(x,y)p_A}{P(x,y)}\\ f'_B(x,y) &= \frac{f_B(x,y)p_B}{P(x,y)} \end{aligned}

by comparing the posterior class probabilities we have

fA(x,y)pA>fB(x,y)pB⇒1π(1+eb)e−x2a−ay2>ebπ(1+eb)e−(x−2)2−(y−3)2f_A(x,y) p_A > f_B(x,y) p_B \Rightarrow \frac{1}{\pi(1+e^{b})}e^{-\frac{x^2}{a} - ay^2} >\frac{e^{b}}{\pi(1+e^{b})}e^{-(x-2)^{2}-(y-3)^{2}}

by set a=1a = 1 we have

1π(1+eb)e−x2−y2>ebπ(1+eb)e−(x−2)2−(y−3)2\frac{1}{\pi(1+e^{b})}e^{-x^{2}-y^{2}} >\frac{e^{b}}{\pi(1+e^{b})}e^{-(x-2)^{2}-(y-3)^{2}}

which can be simplied to

4x+6y+b−13<04x+6y+b-13 < 0

On the boundary 4x+6y+b−13=04x+6y+b-13=0, the posterior probabilities tie.

設問3​

Since the prior probability and posterior probability is equal, we have

fA′(x,y)=fA(x,y)pAP(x,y)=pAf'_A(x,y) = \frac{f_A(x,y)p_A}{P(x,y)} = p_A

which implies that

fA(x,y)=P(x,y).f_A(x,y) = P(x, y).

Note that P(x,y)=pAfA(x,y)+pBfB(x,y)P(x,y) = p_{A}f_{A}(x,y)+p_{B}f_{B}(x,y), hence

(1−pA)fA(x,y)=(1−pA)fB(x,y)(1-p_{A})f_{A}(x,y) = (1-p_{A})f_{B}(x,y)

i.e., fA(x,y)=fB(x,y)f_A(x,y) = f_B(x,y), which implies that

−x2a−ay2=−(x−2)2−(y−3)2\begin{align} -\frac{x^{2}}{a}-ay^{2} = -(x-2)^{2}-(y-3)^{2} \tag{i} \end{align}

solving (i) by substituting (x,y)=(1,1)(x,y) = (1,1), we have

a=5±212a= \frac{5\pm \sqrt{21}}{2}

設問4​

The objective is

T(b)=ln⁡∏i=1nf(xi,yi)=ln⁡∏i=1n(pAfA(xi,yi)+pBfB(xi,yi))=∑i=1nln⁡(pAfA(xi,yi)+pBfB(xi,yi))\begin{aligned} T(b) &= \ln \prod_{i=1}^{n}f(x_{i},y_{i})\\ &= \ln \prod_{i=1}^{n}\left(p_{A}f_{A}(x_{i},y_{i})+p_{B}f_{B}(x_{i},y_{i})\right)\\ &= \sum_{i=1}^{n} \ln \left(p_{A}f_{A}(x_{i},y_{i})+p_{B}f_{B}(x_{i},y_{i})\right)\\ \end{aligned}

by solving the following equations (note that when a=0.5a = 0.5, we have fA(0,0)=1/πf_{A}(0,0)=1/\pi, fA(1,2)=e−4/πf_{A}(1,2)=e^{-4}/\pi, fB(0,0)=e−13/π≈0f_{B}(0,0)=e^{-13}/\pi\approx 0, fB(1,2)=e−2/πf_{B}(1,2)=e^{-2}/\pi.)

∂T(b)∂b=eb1+eb∑i=1n−fA(xi,yi)+fB(xi,yi)fA(xi,yi)+ebfB(xi,yi)=0\begin{aligned} \frac{\partial T(b)}{\partial b} &= \frac{e^{b}}{1+e^{b}}\sum_{i=1}^{n}\frac{-f_{A}(x_{i},y_{i})+f_{B}(x_{i},y_{i})}{f_{A}(x_{i},y_{i})+e^{b}f_{B}(x_{i},y_{i})} = 0 \end{aligned}

Using the stated approximation, we obtain

−e−4+e−2e−4+eb−2=1⇒b^≃ln⁡(e2−2)−2\frac{-e^{-4}+e^{-2}}{e^{-4}+e^{b-2}} = 1 \Rightarrow \hat b \simeq \ln(e^{2}-2)-2

To verify that this is the maximum, put q=pA∈(0,1)q=p_A\in(0,1). Apart from the positive factor π−2\pi^{-2}, the approximate likelihood is

q(qe−4+(1−q)e−2),q\bigl(qe^{-4}+(1-q)e^{-2}\bigr),

a strictly concave quadratic. Its maximizer is q=1/[2(1−e−2)]∈(0,1)q=1/[2(1-e^{-2})]\in(0,1), giving the value above. With the small term retained, the exact maximizer is

q^=1−e−13(2−e−2)2(1−e−13)(1−e−2),b^=log⁡1−q^q^.\hat q= \frac{1-e^{-13}(2-e^{-2})}{2(1-e^{-13})(1-e^{-2})}, \qquad \hat b=\log\frac{1-\hat q}{\hat q}.