Skip to content

Issue with non-diagonal covariance matrices in model definition #174

Description

@wlwetzel

I was attempting to define a mamba model with a multivariate normal distribution for the data:

model = Model(
    PMT = Stochastic(1,
        (mu,sigma) -> MvNormal(mu,sigma),
        false),
    mu = Logical(1,
        (x,y) -> makeMeans(x,y)
        ),
    sigma = Logical(2 ,
        (x,y) -> makeCov(x,y)
        ),
    x = Stochastic(
        () -> Normal(0,1)
        ),
    y = Stochastic(
        () -> Normal(0,1)
        )
)

makeMeans and makeCov return a length 4 vector and a 4x4 matrix.

I get the following error when trying to run mcmc:

ERROR: MethodError: no method matching PDMats.PDMat(::ArrayLogical{2})
Closest candidates are:
  PDMats.PDMat(::AbstractMatrix, ::Cholesky) at ~/.julia/packages/PDMats/HCniD/src/pdmat.jl:12
  PDMats.PDMat(::Cholesky) at ~/.julia/packages/PDMats/HCniD/src/pdmat.jl:21
  PDMats.PDMat(::Symmetric) at ~/.julia/packages/PDMats/HCniD/src/pdmat.jl:20

I can run mcmc if I replace sigma with a scalar, so it seems it's an issue with using a matrix for the covariance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions