Sei sulla pagina 1di 2

CMPE 58K, Assignment 3

Expectation-Maximization derivation
AR(1) model is defined as follows

A ∼ p(A) = N (A|0, P )

R ∼ p(R) = IG(R|α, β)

x1 |x0 , A, R ∼ p(x1 |x0 , A, R) = N (x1 |Ax0 , R)


Here, IG denotes the inverse gamma density function:

1 r−(a+1) b
IG(r|a, b) = exp(− )
Γ(a) b−a r
In the last lecture, we derived equations to implement Expectation-Maximization
to maximize A parameter. Below is the derivation:
We want to find

A∗ = arg max p(A|x) = arg max log p(A, x)


A A

The log of posterior is tightly bounded by the function B(A|Aold ), by Jensen’s


inequality:

Lx (A) = log p(A, x)


Z
= log dR p(A, R, x)

p(R|x, Aold )
Z
= log dR p(A, R, x)
p(R|x, Aold )
≥ hlogp(A, R, x)ip(R|x,Aold ) − log p(R|x, Aold ) p(R|x,Aold )

We derive the log of the joint density function:

φ = log p(A, R, x) = log N (x1 |Ax0 , R) + log N (A|0, P ) + log IG(R|α, β)


1 1 x21 x1 Ax0 1 A2 x20
= − log2πR − + −
2 2R R 2 R
1 1 A2 β
− log2πP − − (α + 1)logR − − logΓ(α) + αlogβ
2 2 P R
As x and Aold are known, p(R|x, Aold ) is the full conditional that only de-
pends on R. Thus, we derive it by choosing only terms of φ that depend on
R:

1
1 1 (x1 − Ax0 )2 β
log p(R|x, Aold ) =+ − logR − (α + 1)logR − −
2 2 R R
3 1 2 1
= −(α + )logR − ( (x1 − Ax0 ) + β)
2 2 R
+ 1 1 2
= log IG(R; α + , (x1 − Ax0 ) )
2 2
We found that p(R|x, Aold ) is distributed according to an inverse gamma
density with known parameters. Now we return to the bounding function. We
only choose terms of φ that depend on A:

A2 x20 A2
 
old + x1 Ax0
B(A|A )= − −
R 2R 2P p(R|x,Aold )
2 2
A2
 
A x0 1
= (x1 Ax0 − ) −
2 R p(R|x,Aold ) 2P

Let z be the expectation of R−1 in the inverse gamma density:


 
1
z=
R p(R|x,Aold )
We continue:

A2 x20 A2
B(A|Aold ) =+ (x1 Ax0 − )z −
2 2P
We take derivative with respect to A and equate to zero to find Anew :

δB(A|Aold )
0=
δA
Anew
0 = x1 x0 z − Anew x20 z −
P
zx1 x0
Anew =
x20 z
+ P −1

Question:

• Make the derivations to implement EM to maximize R parameter!

R∗ = arg max p(R|x) = arg max log p(R, x)


R R

Potrebbero piacerti anche