Skip to content

Issue in MarginalizedLinear.conditional() #41

Description

@adrn

I've been using MarginalizedLinear for a while but only recently have been playing with having non-zero prior means. Things seem to be working within .log_prob, but when using .conditional to generate samples for the linear parameters, the returned samples aren't centered properly. I think this is because of a bug in:
https://github.com/dfm/numpyro-ext/blob/main/src/numpyro_ext/distributions.py#L545

This line is effectively computing:

alpha = self.data_linear_op.solve_tril(
        (value - self.data_distribution.mean - (self.design_matrix @ mu))[..., None], False
    )

but I think it should actually be:

alpha = self.data_linear_op.solve_tril(
        (value - self.data_distribution.mean)[..., None], False
    )

(I implemented the fix in my fork but just FYI)

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