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'm not sure if this is a bug with Distributions.jl or BlockDiagonals.jl...
I have a block diagonal matrix V where each block is explicitly wrapped by Symmetric, but I cannot input V into the MvNormal constructor in Distributions.jl.
x1 =rand(5, 5)
x2 =rand(5, 5)
V1 =Symmetric(x1'*x1)
V2 =Symmetric(x2'*x2)
V =BlockDiagonal([V1, V2])
μ =rand(10)
MvNormal(μ, V)
MethodError: Cannot `convert` an object of type
BlockDiagonal{Float64{},Symmetric{Float64, Matrix{Float64}}} to an object of type
BlockDiagonal{Float64{},UpperTriangular{Float64, Matrix{Float64}}}
Closest candidates are:convert(::Type{T}, ::Factorization) where T<:AbstractArray at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/factorization.jl:58convert(::Type{T}, ::T) where T<:AbstractArray at abstractarray.jl:14convert(::Type{T}, ::T) where T at essentials.jl:205
Stacktrace:
[1] PDMats.PDMat(mat::BlockDiagonal{Float64, Symmetric{Float64, Matrix{Float64}}}, chol::Cholesky{Float64, BlockDiagonal{Float64, UpperTriangular{Float64, Matrix{Float64}}}})
@ PDMats ~/.julia/packages/PDMats/YXkIE/src/pdmat.jl:16
[2] PDMats.PDMat(mat::BlockDiagonal{Float64, Symmetric{Float64, Matrix{Float64}}})
@ PDMats ~/.julia/packages/PDMats/YXkIE/src/pdmat.jl:19
[3] MvNormal(μ::Vector{Float64}, Σ::BlockDiagonal{Float64, Symmetric{Float64, Matrix{Float64}}})
@ Distributions ~/.julia/packages/Distributions/N1Ika/src/multivariate/mvnormal.jl:201
[4] top-level scope
@ In[144]:6
[5] eval
@ ./boot.jl:360 [inlined]
[6] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base ./loading.jl:1116
I have no idea why it's trying to convert a symmetric matrix into an uppertriangular matrix.
The text was updated successfully, but these errors were encountered:
I'm not sure if this is a bug with Distributions.jl or BlockDiagonals.jl...
I have a block diagonal matrix
V
where each block is explicitly wrapped bySymmetric
, but I cannot inputV
into theMvNormal
constructor in Distributions.jl.I have no idea why it's trying to convert a symmetric matrix into an uppertriangular matrix.
The text was updated successfully, but these errors were encountered: