Stabilize gp.Latent.conditional covariance with jitter (fixes #8108)#8109
Open
mullachv wants to merge 1 commit intopymc-devs:mainfrom
Open
Stabilize gp.Latent.conditional covariance with jitter (fixes #8108)#8109mullachv wants to merge 1 commit intopymc-devs:mainfrom
mullachv wants to merge 1 commit intopymc-devs:mainfrom
Conversation
twiecki
approved these changes
Feb 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8109 +/- ##
=======================================
Coverage 91.49% 91.49%
=======================================
Files 123 123
Lines 19832 19832
=======================================
Hits 18146 18146
Misses 1686 1686
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stabilize gp.Latent.conditional covariance with jitter (fixes #8108)
Description
With large
Xnewarrays,gp.Latent.conditionalcould raiseLinAlgError: Matrix is not positive definitebecause the conditional covariance matrix was not numerically stabilized. Thejitterargument was only applied to the prior covarianceK(X,X)before Cholesky, not to the conditional covarianceK(Xnew,Xnew) - K(Xnew,X) K(X,X)^{-1} K(X,Xnew).Changes:
stabilize(..., jitter)to the conditional covariance inLatent._build_conditionalsojitteris used for conditional covariance passed toMvNormal.TP._build_conditionalfor consistency.testLatentConditionalLargeXnewJitterthat builds the model from issue BUG:gp.Latent.conditionalconditional cov needs stabilizing? #8108 (99 training points, 500 prediction points, ExpQuad,jitter=1e-4) and evaluates the compiled logp to ensure no LinAlgError.Related Issue
gp.Latent.conditionalconditional cov needs stabilizing? #8108Checklist
Type of change