Skip to content

BUG: gp.Latent.conditional conditional cov needs stabilizing? #8108

@elc45

Description

@elc45

Describe the issue:

With big Xnew arrays, the conditional covariance matrix breaks the model I think because it's not stabilized. The jitter argument is never applied to it. Adding the commented bit of code in fixes the error, but probably unideal.

Reproduceable code example:

= depth.reshape(-1, 1)[::-1]
X = np.arange(99, 0, -1).reshape(-1, 1)
depth_grid = np.linspace(100, 1, 500).reshape(-1, 1)

with pm.Model() as model:
    cov = pm.gp.cov.ExpQuad(input_dim=1, ls=1)# + pm.gp.cov.WhiteNoise(sigma=1e-2)
    gp = pm.gp.Latent(cov_func=cov)

    f = gp.prior("f", X=X)

    f_grid = gp.conditional("f_grid", Xnew=depth_grid, jitter=1e-4)

Error message:

LinAlgError: Matrix is not positive definite

PyMC version information:

5.21.1

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions