Download Gaussian processes in Bayesian modeling: User guide for Matlab

Transcript
2.2. MARGINAL LIKELIHOOD GIVEN PARAMETERS
−0.8
−0.55
−0.3
(a) Disease mapping
−10
−5
11
0
(b) Classification
Figure 2.1: Illustration of the Laplace approximation (solid line), EP (dashed line) and
MCMC (histogram) for the conditional posterior of a latent variable p(fi |D, θ) in two
applications. On the left, a disease mapping problem with Poisson observation model
(used in Vanhatalo et al., 2010) where the Gaussian approximation works well. On the
right, a classification problem with probit likelihood (used in Vanhatalo and Vehtari,
2010) where the posterior is skewed and the Gaussian approximation is quite poor.
where f (i) is the i’th sample from the conditional posterior. The problem with Monte
Carlo methods is how to draw samples from arbitrary distributions. The challenge can
be overcome with Markov chain Monte Carlo methods (Gilks et al., 1996), where one
constructs a Markov chain whose stationary distribution is the posterior distribution
p(f |D, θ, ?φ) and uses the Markov chain samples to obtain Monte Carlo estimates. A
rather efficient sampling algorithm is hybrid Monte Carlo (HMC) (Duane et al., 1987;
Neal, 1996), which utilizes the gradient information of the posterior distribution to direct the sampling in interesting regions. Significant improvement in mixing of the sample chain of the latent variables can be obtained by using the variable transformation
discussed in (Christensen et al., 2006; Vanhatalo and Vehtari, 2007). After having the
posterior sample of latent variables, we can sample from the posterior predictive distri(i)
bution of any set of f̃ simply by sampling with each f (i) one f̃ from p(f̃ | f (i) , θ, φ),
which is given in the equation (1.9). Similarly, we can obtain a sample of ỹ by drawing
one ỹ(i) for each f̃
2.2
(i)
from p(ỹ|f̃
(i)
, θ, φ).
Marginal likelihood given parameters
In Bayesian inference we integrate over the unknown latent values to get the marginal
likelihood. In Gaussian case this is straightforward since it has an analytic solution (see
equation (2.8)) and log marginal likelihood is
log p(D|θ, σ) = −
1
1
n
log(2π) − log | Kf,f +σ 2 I| − yT (Kf,f +σ 2 I)−1 y, (2.18)
2
2
2
If the observation model is not Gaussian the marginal likelihood needs to be approximated. The Laplace approximation to the marginal likelihood (denominator in
the equation (2.1)) is constructed, for example, by writing
Z
Z
p(D|θ, φ) = p(y| f , φ)p(f |X, θ)d f = exp(g(f ))d f ,
(2.19)
after which a second order Taylor expansion around f̂ is done for g(f ). This gives a