Skip to content
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

cov does not preserve type #1693

Open
Vilin97 opened this issue Mar 9, 2023 · 2 comments
Open

cov does not preserve type #1693

Vilin97 opened this issue Mar 9, 2023 · 2 comments

Comments

@Vilin97
Copy link

Vilin97 commented Mar 9, 2023

It can be important (e.g. with sparse matrices) to preserve the type of the covariance matrix. I have not tested other distributions but MvNormal does not preserve the type:

julia> typeof(I(2)) # sparse
Diagonal{Bool, Vector{Bool}}

julia> typeof(cov(MvNormal(I(2)))) # full        
Matrix{Bool} (alias for Array{Bool, 2})   

julia> sizeof(I(10^5)) # no memory used
8

julia> sizeof(cov(MvNormal(I(10^5)))) # lots of memory used     
10000000000
@devmotion
Copy link
Member

I think this is a duplicate of #572 which is fixed by #1373.

@Vilin97
Copy link
Author

Vilin97 commented Mar 14, 2023

It looks like that PR is abandoned though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants