Skip to content

Wishart rand promotes to Float64 #1666

@bvdmitri

Description

@bvdmitri

The following code should not promote to Float64

julia> Wishart(3f0, [ 1f0;; ]) |> rand
1×1 Matrix{Float64}:
 1.7289491201235807

Works fine for other distributions (I didn't check all of them though):

julia> Normal(0f0, 1f0) |> rand
0.4961709f0

julia> MvNormal([ 0f0 ], [ 1f0 ]) |> rand
1-element Vector{Float32}:
 -0.06129361

logpdf seems to be fine for Wishart:

julia> logpdf(Wishart(3f0, [ 1f0;; ]), [1f0;;])
-1.4189385f0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions