Homepage Solution manuals Kevin P. Murphy Machine Learning: a Probabilistic Perspective Exercise 9.1 - Conjugate prior for univariate Gaussian in exponential family form

Exercise 9.1 - Conjugate prior for univariate Gaussian in exponential family form

Answers

Recall that the 1d Gaussian distribution is:

𝒩 ( x | μ , σ 2 ) = 1 2 π σ 2 exp { 1 2 σ 2 ( x μ ) 2 } .

Rewrite it into the standard exponential family form:

p ( x | μ , σ 2 ) = exp { 1 2 σ 2 x 2 + μ σ 2 x { μ 2 2 σ 2 + ln ( 2 π σ 2 ) 2 } } .

With λ = 1 σ 2 , denote:

𝜃 = ( λ 2 , 𝜆𝜇 ) T , ϕ ( x ) = ( x 2 , x ) T , A ( 𝜃 ) = λ μ 2 2 + ln ( 2 π ) 2 ln λ 2 .

Now consider the likelihood w.r.t. a dataset 𝒟 = { x n } n = 1 N :

log p ( 𝒟 | 𝜃 ) = 𝜃 T ( n = 1 N ϕ ( x n ) ) N A ( 𝜃 ) .

The prior distribution of 𝜃 should satisfy the following variational form:

p ( 𝜃 | 𝐯 , M ) = exp { 𝜃 T 𝐯 + M A ( 𝜃 ) } = exp { 𝜃 1 v 1 + 𝜃 2 v 2 + M A ( 𝜃 ) } = exp { λ v 1 2 + 𝜆𝜇 v 2 + M ( λ μ 2 2 + ln ( 2 π ) 2 ln λ 2 ) } = exp { λ v 1 2 M ln λ 2 + 𝜆𝜇 v 2 + 𝑀𝜆 μ 2 2 } exp { ln 2 π 2 } exp { λ v 1 2 M ln λ 2 } exp { 𝜆𝜇 v 2 + 𝑀𝜆 μ 2 2 } .

The first term, in which λ is the target variable, takes the form of a Gamma distribution since:

Ga ( λ | α , β ) exp { 𝛽𝜆 + ( α 1 ) ln λ } .

The second term is just another Gaussian distribution since the sufficient statistics are μ and μ 2 . Combine these two observations together, we have:

p ( 𝜃 | 𝐯 , M ) = Ga ( λ | α , β ) 𝒩 ( μ | γ , τ 2 ) .

The transformations between variables are:

β = v 1 2 , α = 1 M 2 , τ 2 = 1 𝑀𝜆 , γ = v 2 M .

In case the variance of the prior for μ is written in the information form, the precision can be written by: λ ( 2 α 2 ) .

User profile picture
2021-03-24 13:42
Comments