Skip to content

How to calculate likelihoods? (sklearn reproduction) #1661

Answered by jacobrgardner
bcolloran asked this question in Q&A
Discussion options

You must be logged in to vote

Looking at your notebook, the first thing I notice is that you're computing the log likelihood using K = model.covar_module(X_torch) as the covariance matrix. Note that this doesn't include the likelihood noise -- e.g., it's not K + \sigma^2 I. The + \sigma^2 I is actually extremely important, even when \sigma is small. This is because kernel matrices can easily have smallest eigenvalues on the order of like 1e-30, so even when \sigma is like 0.01, adding \sigma^2 I can increase the smallest eigenvalue of K by like 25 orders of magnitude.

Given how both the log determinant and the linear solve K^{-1}y relate to the eigenvalues of the underlying matrix, this would be my first guess to expl…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bcolloran
Comment options

Answer selected by bcolloran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants