Homepage Solution manuals Kevin P. Murphy Machine Learning: a Probabilistic Perspective Exercise 21.1 - Laplace approximation to $p(\mu,\log \sigma|\mathcal{D})$ for a univariate Gaussian

Exercise 21.1 - Laplace approximation to $p(\mu,\log \sigma|\mathcal{D})$ for a univariate Gaussian

Answers

Laplace approximation aims at representing f ( μ , l ) = log p ( μ , l = log σ | D ) from its first and second-order gradients. We have:

log p ( μ , l | 𝒟 ) = log p ( μ , l , 𝒟 ) log p ( 𝒟 ) = log p ( μ , l ) + log p ( 𝒟 | μ , l ) + const = log p ( 𝒟 | μ , l ) + const = n = 1 N log 1 2 π σ 2 exp { ( y n μ ) 2 2 σ 2 } + const = N log σ + n = 1 N ( y n μ ) 2 2 σ 2 + const = N l exp ( 2 l ) 2 n = 1 N ( y n μ ) 2 + const .

Thus we can take gradients:

log p ( μ , l | 𝒟 ) ∂𝜇 = exp ( 2 l ) 2 n = 1 N 2 ( y n μ ) = N σ 2 ( ȳ μ ) , log p ( μ , l | 𝒟 ) ∂𝑙 = N 2 exp ( 2 l ) 2 n = 1 N ( y n μ ) 2 = N + 1 σ 2 n = 1 N ( y n μ ) 2 , 2 log p ( μ , l | 𝒟 ) μ 2 = N σ 2 , 2 log p ( μ , l | 𝒟 ) l 2 = 2 σ 2 n = 1 N ( y n μ ) 2 , 2 log p ( μ , l | 𝒟 ) ∂𝜇∂𝑙 = N ( ȳ μ ) ( 2 ) 1 σ 2 .

Finally, to conduct the Laplace approximation, recall that:

f ( μ , l ) const + ( ∂𝑓 ∂𝜇 ∂𝑓 ∂𝑙 ) ( μ l ) + 1 2 ( μ l ) 𝐇 ( μ l ) .

With this expansion in mind, we have:

p ( μ , l ) = exp ( l ( μ , l ) ) = const exp { 1 2 ( μ m 1 l m 2 ) Λ ( μ m 1 l m 2 ) } .

Calibrating the coefficient, we know that the covariance and the mean for this approximation are:

Σ = ( 2 log p ( μ , l | D ) μ 2 2 log p ( μ , l | D ) l 2 2 log p ( μ , l | D ) l 2 2 log p ( μ , l | D ) ∂𝜇∂𝑙 ) 1 ,

m = ( 2 log p ( μ , l | D ) μ 2 2 log p ( μ , l | D ) l 2 2 log p ( μ , l | D ) l 2 2 log p ( μ , l | D ) ∂𝜇∂𝑙 ) ( ∂𝑓 ∂𝜇 ∂𝑓 ∂𝑙 ) .

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