




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Thursday, September 11, 2008 Rice University STAT 631 / ELEC 639: Graphical Models
Instructor: Dr. Volkan Cevher
Scribe: Ryan Guerra Reviewers: Beth Bower and Terrance Savitsky
Index Terms: Laplace Approximation, Approximate Inference, Taylor Series, Chi Distri- bution, Normal Distribution, Probability Density Function
When we left off with the Joint Tree Algorithm and the Max-Sum Algorithm last class, we had crafted “messages” to transverse a tree-structured graphical model in order to calculate marginal and joint distributions. We are interested in finding p(z|x) when p(x) is given as shown below.
z x
Figure 1. Graph representing both hidden (clear) and observed (shaded) variables with their conditional dependance indicated by the arrow.
In this case, x is our “observed variable” and z is our “given variable” for which we wish to make some inference. While we would normally wish to make some sort of exact inference about p(z|x), this problem is often either impossible to solve or the required algorithm is intractable.
The next few lectures will focus on deterministic approximations to a pdf and then we will move on to stochastic approximations. The general hierarchy of approximation techniques is given here for reference.
Approximate Inference
(1) Laplace (local)
(2) Variational Bayes (global)
(3) Expectation Propagation (both)
(1) Metropolis-Hastings/Gibbs
(2) SIS
1.1. Motivation for Representation. The idea here is that we wish to approximate any pdf such as the one given below with a nice, simple representation.
Figure 2. An example multi-modal distribution that we want to approximate.
The Laplace approximation is a method for using a Gaussian ∼ N (μ, σ^2 ) to represent a given pdf. This is obviously more effective for a single-mode^1 distribution, as many popular distributions could be roughly represented with a Gaussian.
As an example of what we mean by “represent,” consider that we have some function g(x) distributed according to the density function p(x) and we wish to get the expected value E{g(x)} through sampling.
E{g(x)} =
g(x)p(x)dx
We wish to calculate this expected value by sampling discrete values from p(z), and thus get an estimate Eˆ[g(x)] for E[g(x)] that can be calculated as such:
Eˆ{g(x)} =^1 L
i=
g(xi)
(^1) A mode is a concentration of mass in a pdf. We could imagine a non-nice distribution like a U-quadratic that may not have its mass concentrated in a single area that would be poorly represented by the Laplace approximation.
(1) ln f (x) = ln f (x 0 ) +
∂ ln f (x) ∂x
x=x 0
· (x − x 0 ) ︸ ︷︷ ︸ second term
∂^2 ln f (x) ∂x^2
x=x 0
· (x − x 0 )^2 + h.o.t...
Let’s assume that the higher-order terms are negligible and focus, for now, on the second term in (1):
∂ ln f (x) ∂x
x=x 0
· (x − x 0 ) =
f (x)
∂f (x) ∂x
︸ ︷︷ x=x^0 ︸
·(x − x 0 )
We notice that (*) is zero at local maxima of the pdf. If we find this local maxima and choose to expand our Taylor series around this point xmax we ensure that the second term in the RHS of (1) is always zero. This is done by setting ∂f ∂x^ (x )equal to zero and solving for xmax, the local maxima of the pdf.
Taking the first three terms of the Taylor series expansion around x 0 = xmax, then (1) becomes:
ln f (x) = ln f (xmax) +
∂^2 ln f (x) ∂x^2
x=xmax
(3) · (x − xmax)^2
eln^ f^ (x)^ = exp
ln f (xmax) +
∂^2 ln f (x) ∂x^2
x=xmax
· (x − xmax)^2
eln^ f^ (x)dx = e ︸ln f^ ︷︷(xmax ︸) constant
exp
∂^2 ln f (x) ∂x^2
︸ ︷︷ x=xmax︸ constant
·(x − xmax)^2
(5) dx
Where we took the exponent in (4) and integrated both sides in (5). We see that the RHS of (5) contains a bunch of constants and a single term inside the exponent that is quadratic with respect to x. For the sake of simplicity, let’s let ln f (x) = F (x). Then if we let σ^2 = − (^) L′′(x^1 max) we get a result that looks remarkably like a Gaussian!
eL(x)dx ≈ eL(xmax)
exp
(x − xmax)^2 2 σ^2
dx
This is the result of the Laplace method for integrals, though it is cited with an additional term n and with the traditional notation xmax = x∗^ in Tierney & Kadane [3] as:
enL(x)dx ≈ enL(x
exp
− n(x−x
∗) 2 2 σ^2
dx =
2 πσn−^
1 (7)^2 enL(x∗)
1.3. Application. To elaborate further on what (7) gets us, I’m going to borrow from Tierney & Kadane’s paper. Given a smooth, positive function g, we wish to approximate the posterior mean of g(x).
(8) En[g(x)] = E[g(x)|Y (n)] =
P r[g, Y (n)] P r[Y (n)]
g ∫( x)eL(x)π(x)dx eL(x)π(x)dx
Where L(x) is the log-likelihood function ln p(x), π(x) is the prior density, and Y (n)^ is the observed set of data. As we can see, the forms of the integrals in (8) are very similar to the forms seen in (7), and are then easily estimated by the Laplace approximation of a pdf. But you can read the paper if you’re interested.
We now have a step-by-step process for using the Laplace approximation to approximate a single-mode pdf with a Gaussian:
(1) find a local maximum xmax of the given pdf f (x)
(2) calculate the variance σ^2 = − (^) f ′′(x^1 max)
(3) approximate the pdf with p(x) ≈ N [xmax, σ^2 ]
1.4. Example: Chi distribution. p(x) = x
k− (^1) e−^ x 22 z ,^ z^ = 2^
k 2 −^1 Γ( k 2 ), x > 0
Note that z is a normalization constant that doesn’t depend on x. Apparently most books don’t even bother with it, and we’ll ignore it here for the sake of convenience. Remember that we’re working with the log-likelihood here, so f (x) = ln p(x)
f (x) = ln p(x) = ln xk−^1 + ln e−^
x^2 2 ∂ ∂x
ln p(x) =
∂x
ln xk−^1 −
x^2 2
xk−^1
· (k − 1)xk−^2 − x
k − 1 x
− x = 0
x∗^ =
k − 1
Now that we’ve found the local maximum x∗, we compute the variance σ^2 = − (^) f ′′(^1 x∗)
Figure 5. The Graphical Model
Figure 6. Laplace Approximation v. Monte Carlo sampling
The Laplace approximation appears to do well approximating the posterior. The authors note that the Monte Carlo method takes 20 times longer computationally than the Laplace approximation, making Laplace approximation suitable for this example.
References
[1] Adriano Azevedo-Filho and Ross D. Shachter. Laplace’s method approximations for probabilistic infer- ence in belief networks with continuous variables. Uncertainty in Artificial Intelligence, 1994. [2] Christopher Bishop. Pattern Recognition and Machine Learning. Springer, 2007.
[3] Luke Tierney and Joseph Kadane. Accurate approximations for posterior moments and marginal den- sities. Journal of the American Statistical Association, 81(393), 1986.