Skip to content

Add rng_fn to CAR/ICAR #7713

@jessegrabowski

Description

@jessegrabowski
Member

Description

I was talking to @theorashid who linked me to this case study of CAR priors. It seems like they're just MvNormals, but with degenerate covariance matrices. We can now sample from such distributions use the new method="eig" or method="svd" argument. So a potential rng_fn would just make an appropriate MvNormal with the method argument set, then return it's rng_fn.

Looking at the logp method for these distributions, it seems like it's just using the eig method; so we might be able to simplify these to wrappers around MvNormalRV that just constructs the mean/covariance and sets the appropriate method, but that's a step beyond what this PR is asking for.

Activity

ricardoV94

ricardoV94 commented on Mar 9, 2025

@ricardoV94
Member

Plus some special logic for sparse covariances that would be nice to support in MvNormal as well?

jessegrabowski

jessegrabowski commented on Mar 9, 2025

@jessegrabowski
MemberAuthor

A hidden internal SparseMvNormal, in the vein of PrecisionMvNormal would be nice. We could rewrite to it when we see the covariance is sparse.

One issue I foresee is that we don't have sparse implementations of relevant algorithms (Cholesky, Eig, SVD, and Solve). I know sparse cholesky exists, because @bwengals was telling me it's a nice one for GP stuff. For the others I have no idea.

But also beyond the scope of this issue

Muhammad-Rebaal

Muhammad-Rebaal commented on Mar 11, 2025

@Muhammad-Rebaal

Hi @jessegrabowski !
Hope you are fine !
If no one is working on this issue , could you assign this to me I'd like to solve this.
Thank You !

ricardoV94

ricardoV94 commented on Mar 11, 2025

@ricardoV94
Member

We don't assign issues, you can just open a PR

Muhammad-Rebaal

Muhammad-Rebaal commented on Mar 11, 2025

@Muhammad-Rebaal

We don't assign issues, you can just open a PR

Ok sure thing I'll open a draft one.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ricardoV94@jessegrabowski@Muhammad-Rebaal

        Issue actions

          Add `rng_fn` to CAR/ICAR · Issue #7713 · pymc-devs/pymc