Marginal likelihood measures how well a Gaussian process explains its training data under particular model settings. Comparing likelihoods turns modeling choices into a practical selection problem: prefer the mean or covariance parameters that assign higher likelihood to the observations. section 3.3.2
For a Gaussian process, the marginal log likelihood is computed from the model and its hyperparameters. Maximizing it seeks the settings that explain the observed data best; gradient descent performs this search by repeatedly updating the parameters toward higher likelihood. section 3.3.2 section 3.4.1
Choosing a constant mean
Suppose observations come from an exclusively positive function. Compare Gaussian processes with constant means of 0 and 2. The model reverting to 2 receives the higher likelihood because that mean explains the training observations better. In code, GPyTorch constructs an ExactMarginalLogLikelihood, minimizes its negative value with Adam, and tracks convergence of the mean and loss. section 3.3.2
The same objective selects covariance behavior. Optimizing the length scale and output scale can produce a smoother GP with a wider prediction range; for a three-point dataset, gradient descent found values of roughly 1.3 and 2.1. section 3.4.1
Figure 3.6 GP predictions, given two different constant mean functions. The value 2 gives a higher likelihood value than the value 0, indicating the former mean function is a better fit than the latter.
Compare the two GP predictions to see how the higher-likelihood constant mean better fits the training observations. section 3.3.2
