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
The eltype of, for instance, NormalInverseGamma should be Tuple{Float64, Float64}, but instead is given as Float64. This means that rand chokes because it allocates an array of floats instead of an array of tuples:
julia> d = ConjugatePriors.NormalInverseGamma(0., 1., 2, 2)
ConjugatePriors.NormalInverseGamma{Float64}(mu=0.0, v0=1.0, shape=2.0, scale=2.0)
julia>rand(d)
(-0.6216462947065958, 0.7004872075936253)
julia>rand(d, 2)
ERROR: MethodError: Cannot `convert` an object of type Tuple{Float64,Float64} to an object of type Float64
This may have arisen from a call to the constructor Float64(...),
since type constructors fall back to convert methods.
Stacktrace:
[1] _rand!(::ConjugatePriors.NormalInverseGamma{Float64}, ::Array{Float64,1}) at /home/dave/.julia/v0.6/Distributions/src/genericrand.jl:37
[2] rand(::ConjugatePriors.NormalInverseGamma{Float64}, ::Int64) at /home/dave/.julia/v0.6/Distributions/src/univariates.jl:182
julia>eltype(d)
Float64
The text was updated successfully, but these errors were encountered:
The eltype of, for instance,
NormalInverseGamma
should beTuple{Float64, Float64}
, but instead is given asFloat64
. This means thatrand
chokes because it allocates an array of floats instead of an array of tuples:The text was updated successfully, but these errors were encountered: