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

Wishart samples are always Float64, regardless partype #960

Open
johnczito opened this issue Aug 23, 2019 · 3 comments
Open

Wishart samples are always Float64, regardless partype #960

johnczito opened this issue Aug 23, 2019 · 3 comments

Comments

@johnczito
Copy link
Member

To clarify, this is not the expected behavior, correct?

julia> using Distributions, LinearAlgebra

julia> d = Wishart(Float32(4), Matrix{Float32}(I, 2, 2))

julia> partype(d)
Float32

julia> rand(d)
2×2 Array{Float64,2}:
 1.47454  1.53805
 1.53805  6.80249

The sample should be Array{Float32,2}. If so, I'll submit a PR to fix.

@mschauer
Copy link
Member

In the fix, also add eltype ... or wait for #951

@richardreeve
Copy link
Contributor

Yes, it turns out that almost every single distribution fails to return the right type from quantile() and most from rand(). I'm going through fixing them all as part of #951.

@johnczito
Copy link
Member Author

@richardreeve Very good. Thanks for that. Most of the matrix-variates rely on the Wishart for sampling at some point. So fixing it will be a big step toward straightening all of them out.

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

3 participants