PDMats.jl icon indicating copy to clipboard operation
PDMats.jl copied to clipboard

Design question/discussion: PDMat without constructing full matrix

Open st-- opened this issue 4 years ago • 1 comments

As pointed out in the README, PDMat always stores both Cholesky factorisation and full matrix. For many operations that are commonly used downstream, such as logdet and the quadratic forms, the full matrix is never used. So when the PDMat is constructed from an already known Cholesky factor (e.g. because we optimize for a variationally optimal covariance matrix), this is an unnecessary computation (see https://github.com/invenia/ParameterHandling.jl/issues/41#issuecomment-936495430).

What are the design reasons for the current setup? What would it take to change this? Could we, for example, have some lazy way of computing mat (or chol) only when it is actually required [and then caching it]?

st-- avatar Oct 27 '21 08:10 st--

What are the PDMats.jl maintainers' thoughts on this?

st-- avatar Mar 31 '22 08:03 st--