Skip to content

ENH: Measurable dot and matmul #6950

@jessegrabowski

Description

@jessegrabowski

Before

def scaled_mv_normal(mu, cov, R):
    return pm.MvNormal.dist(mu=R @ mu, cov= R @ cov @ R.T)

After

def scaled_mv_normal(mu, cov, R):
    return R @ pm.MvNormal.dist(mu=mu, cov=cov)

Context for the issue:

Currently, the automatic logp inference isn't able to handle dot products or matrix multiplication of a multivariate normal with a deterministic vector/matrix. Since there are closed form results for these cases (it's essentially the same as repeated shifting/scaling/convolution of normals), it seems like it should be possible to have a measurable_dot and measurable_matmul, at least in the MvNormal case?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions