跳到主要内容

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

Author

祭音Myyura

Description

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

fA(x,y)=1πexp(x2aay2), fB(x,y)=1πexp((x2)2(y3)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=1pAp_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) がクラス AABB のいずれに属するかを、クラスの事後確率の大小を比較することで判定する。データ点 (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 としてよい。

Kai

設問1

We only need to find the value of aa that maximizes the log-joint likelihood function L(a)L(a)

L(a)=lni=1n{pAfA(xi,yi)+pBfB(xi,yi)}lni=1nfA(xi,yi)=nlnπ1ai=1nxi2ai=1nyi2\begin{aligned} L(a) &= \ln \prod_{i=1}^{n}\left\{p_{A}f_{A}(x_{i},y_{i})+p_{B}f_{B}(x_{i},y_{i})\right\}\\ &\propto \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=1a2i=1nxi2i=1nyi2=0a=i=1nxi2i=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}}}

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)pb1π(1+eb)ex2aay2>ebπ(1+eb)e(x2)2(y3)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)ex2y2>ebπ(1+eb)e(x2)2(y3)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

6y+2x+b13<06y+2x+b-13 < 0

設問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

(1pA)fA(x,y)=(1pA)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

x2aay2=(x2)2(y3)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)=lni=1nf(xi,yi)=lni=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)=e4/πf_{A}(1,2)=e^{-4}/\pi, fB(0,0)=e13/π0f_{B}(0,0)=e^{-13}/\pi\approx 0, fB(1,2)=e2/πf_{B}(1,2)=e^{-2}/\pi.)

T(b)b=eb1+ebi=1nfA(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}

we have

e4+e2e4+eb2=1b=ln(e22)2\frac{-e^{-4}+e^{-2}}{e^{-4}+e^{b-2}} = 1 \Rightarrow b = \ln(e^{2}-2)-2