Derive the log marginal likelihood of a GP regression model with , , and its gradient with respect to a kernel hyperparameter . How do the data-fit and complexity terms trade off as the length-scale grows?
Probabilistic models, Gaussian processes
Level L4 Advanced. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can differentiate a Gaussian log-density through a matrix inverse and a log-determinant, and interpret the terms.
Key idea
, and with .
Steps
- Integrating out the latent function gives , so the log density is .
- Use and .
- The derivative is .
- Terms: is the data fit. is the complexity penalty (the log volume of functions the prior allows). The last is a constant.
- Length-scale trade-off: for small , is close to the identity, so is large (a flexible model) and the fit is good only if the data are noisy. For large , is nearly rank one, so is small, but the fit term becomes large since a flat function cannot match wiggly data. The maximum lies in between.
- Cost: one Cholesky of gives and , in . The objective is non-convex in , so use several restarts.
Common mistakes
- Taking the determinant of instead of (leaving out the noise).
- Forgetting the term in the gradient, which is the part that comes from the log-determinant.
- Thinking the marginal likelihood can be increased indefinitely by a more flexible kernel. The complexity term stops this.
How long your answer should be
A page. About 8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Probabilistic models: For Bayesian linear regression with prior and noise precision , derive the log evidence . Which terms reward fit, and which penalise complexity?
Next in Probabilistic models: The target is a bivariate Gaussian with zero mean, unit variances and correlation . A mean-field approximation is fitted by minimising . What are the factor variances, and why are they much smaller than the true marginal variances?