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)
I've been using
MarginalizedLinearfor 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.conditionalto 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:
but I think it should actually be:
(I implemented the fix in my fork but just FYI)