Skip to content

Catch Exception in BLR #72

@cortner

Description

@cortner

The following error seems to occur quite frequently:

ERROR: LoadError: PosDefException: matrix is not positive definite; Cholesky factorization failed.
Stacktrace:
  [1] checkpositivedefinite
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/factorization.jl:18 [inlined]
  [2] #cholesky!#152
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/cholesky.jl:268 [inlined]
  [3] cholesky! (repeats 2 times)
    @ ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/cholesky.jl:266 [inlined]
  [4] log_marginal_likelihood_overdetermined!(lml::Float64, grad::Vector{Float64}, X::Matrix{Float64}, y::Vector{Float64}, var_c::Vector{Float64}, var_e::Float64, XTX::Matrix{Float64})
    @ ACEfit.BayesianLinear ~/miniconda3/envs/ase_env/share/julia/packages/ACEfit/eR8hX/src/bayesianlinear.jl:285
.... 

and it keeps going for a while. Maybe this could be caught with a nicer error message explaining what might have gone wrong and what to try next, e.g. adding better data or trying a different solver.

If the solver can be fixed to actually handle this case, even better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions