-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let positive_definite
return a PDMat
#41
Comments
Good point. I don't generally tend to make a lot of use of One alternative would be to make use of the my_pdmat = deferred(PDMat, positive_definite(S)) where It's not quite as clean as returning a edit: fix typo |
(One thing I would definitely be up for is improving the docstring to suggest a strategy like this, or whatever other strategy seems useful) |
Whenever you use an using Distributions, PDMats
@assert MvNormal(ones(1,1)).Σ isa PDMats.PDMat and generally if you want to handle a positive-definite matrix, PDMat would be the right choice, would you not agree with that? What I want to avoid is the unnecessary additional NB- it would be even better if Distributions.jl wouldn't convert it back to a full |
Also, just wanted to point out that PDMats.jl is actually a very lighter-weight dependency - for sure compared to Bijectors.jl and its rat-tail of deps of deps! The only addition would be SuiteSparse from the stdlib. |
That's my trick -- I don't use
It's definitely a choice, and I agree that it has the right kind of semantics, it's just the implementation that I've always taken issue with. Specifically the requirement that
This is probably something that could be improved.
True -- I had never noticed that before. I'd be fine having the additional dep. I wonder whether we should just implement methods directly to handle the types in that package then? i.e. implement |
@st-- I can see the appeal of this change. |
One thing I really like about Julia is the in general very high composability of packages ... but then I find these little things so irritating 😆 surely a |
I think a fairer thing to do, would be to just have |
I like |
If we do something like this, would it make sense to have a |
Why would you care about a positive diagonal? The result would be the same no? |
Positive diagonal means it's a valid cholesky factor, so can just be plugged into stuff that expects that kind of constraint, such as a |
There are other, valid reasons for wanting the diagonal to be positively-constrained. But you can construct |
Sure, you could, but it wouldn't satisfy the assumptions that the |
Ah ok, so it's more about how the |
This would allow for avoiding a Cholesky each time e.g. when parametrising the covariance of an
MvNormal
. Would you be willing to accept the PDMats.jl dependency?The text was updated successfully, but these errors were encountered: