You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
invquad(a::PDMat, x::AbstractVector) =dot(x, a \ x)
In some experiments my suggested way of computing invquad(A,z) more reliably gives positive values (as it always should!) when A and z contain very large values and A is close to singular. This is important when computing logpdf() of a multivariate normal distribution at fairly extreme values using the Distributions.jl package, which appears to use the PDMats invquad() function.
If I understand the source code correctly this is already how the computation is handled in the case of z being a matrix:
An analogous suggestion could also pertain to the computing of quad(A, z), though the numerical stability properties there are probably less of a problem. I'm running Julia 1.1.0 and PDMats 0.9.7.
The text was updated successfully, but these errors were encountered:
For A a
PDMat
and z aVector
, would it not be more numerically stable to computeinvquad(A, z)
asrather than the current:
PDMats.jl/src/pdmat.jl
Line 72 in 3c74b56
In some experiments my suggested way of computing
invquad(A,z)
more reliably gives positive values (as it always should!) when A and z contain very large values and A is close to singular. This is important when computinglogpdf()
of a multivariate normal distribution at fairly extreme values using the Distributions.jl package, which appears to use the PDMatsinvquad()
function.If I understand the source code correctly this is already how the computation is handled in the case of z being a matrix:
PDMats.jl/src/pdmat.jl
Line 110 in 3c74b56
An analogous suggestion could also pertain to the computing of
quad(A, z)
, though the numerical stability properties there are probably less of a problem. I'm running Julia 1.1.0 and PDMats 0.9.7.The text was updated successfully, but these errors were encountered: