You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't quite sure if this should be an upstream issue (i.e. whether this is intended behaviour on the part of PDMats.jl), because ScalMat only keeps a single number as the scale parameter and Julia doesn't convert scalars to Real. On the other hand one could specify the type parameter explicitly:
That's a bug in PDMats IMO. As documented, convert(T, x) should "convert x to a value of type T". Julia's type parameters are invariant, so ScalMat{Float64} is not a subtype of ScalMat{Real}. The scalar case is different: Since Float64 <: Real, convert(Real, 1.0) may (and indeed does) return a Float64.
This comes from here
https://github.com/JuliaStats/Distributions.jl/blob/3de6038ef9b041ceaf649bc324d60ca65fcf09eb/src/multivariate/mvnormal.jl#L190-L193
The underlying issue is that
convert(AbstractArray{Real}, ScalMat(2, 0.5)
, as defined in PDMats.jlPDMats.jl/src/scalmat.jl
Line 11 in 592634b
I wasn't quite sure if this should be an upstream issue (i.e. whether this is intended behaviour on the part of PDMats.jl), because ScalMat only keeps a single number as the scale parameter and Julia doesn't convert scalars to
Real
. On the other hand one could specify the type parameter explicitly:The text was updated successfully, but these errors were encountered: