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

Work with Distributions.jl and PDMats.jl #137

Open
Wu-Chenyang opened this issue Dec 9, 2024 · 1 comment
Open

Work with Distributions.jl and PDMats.jl #137

Wu-Chenyang opened this issue Dec 9, 2024 · 1 comment

Comments

@Wu-Chenyang
Copy link

Currently, the Kronecker can't work with Distributions.jl and PDMats.jl. The following simple code fails.

julia> using Kronecker, Distributions, LinearAlgebra
julia> MvNormal(ones(4), I(2)I(2))
ERROR: MethodError: no method matching PDMats.PDMat(::Kronecker.KroneckerProduct{Bool, Diagonal{…}, Diagonal{…}}, ::CholeskyKronecker{Cholesky{…}, Cholesky{…}})
The type `PDMats.PDMat` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  PDMats.PDMat(::AbstractMatrix, ::Cholesky{T, S}) where {T, S}
   @ PDMats ~/.julia/packages/PDMats/cAM9h/src/pdmat.jl:11
  PDMats.PDMat(::AbstractMatrix)
   @ PDMats ~/.julia/packages/PDMats/cAM9h/src/pdmat.jl:19
  PDMats.PDMat(::Cholesky)
   @ PDMats ~/.julia/packages/PDMats/cAM9h/src/pdmat.jl:20

Is there a workaround for this? It seems requiring CholeskyKronecker to subtype Cholesky.

@MichielStock
Copy link
Owner

MichielStock commented Jan 3, 2025

The issue is that Distributions seems to use PDMmat for the covariance matrix. It would seem useful to be able to use the Matrix normal then.

To avoid type piracy, I think the best option is to copy this issue to PDMats.jl. I'll open an issue there.

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

2 participants