Professional Documents
Culture Documents
1. In
general, forX ∼ N2 (µ, Σ), where X = ( X1 , X2 ) T , µ = (µ1 , µ2 ) T and Σ =
σ12 ρσ1 σ2
, we have
ρσ1 σ2 σ22
σ1 2 2
X1 | X2 = x2 ∼ N µ1 + ρ( x2 − µ2 ), (1 − ρ )σ1 ,
σ2
with ρ being the correlation coefficient.
2. For evaluating the expectation of `(ρ), you can make use of the following two
rules:
• x2T Σ−1 x2 = trace(Σ−1 x2 x2T ).
• if X ∼ N (µ, σ2 ) then X 2 = µ2 + σ2 .
(b) Implement the EM-algorithm. Simulate some data from the model (N = 100
samples) with the true values of parameters θ = 3 and τ = 0.5. Run your EM al-
gorithm to see whether the learned parameters converge close to the true values
(by e.g. just listing the estimates from a few iterations or plotting them).
Hint: You can use ex5 2 template.py as a starting point. As a further aid, you can use
ex5 2 simple em.py, which is a Python implementation of simple example.pdf from
the lecture material.
3. What is Edward?
4. What are the three steps in the iterative process for probabilistic modeling that
Edward is built around?
5. Identify parts of the example probabilistic program (on p. 3–4) that correspond
to the three steps mentioned in the previous question.