I have a noisy physical system that I’m trying the characterize and I want to explore if MCMC bayesian inference can help
The system takes inputs
x and does a dot product with
w are known, so I am not worried about inferring epistemic uncertainty.
x has noise that is additive random normal, and
w has multiplicative noise that is random normal (i.e.
w * N(0, var) so I need to model the heteroscedastic aleatoric uncertainty
From a correctness point of view, I realize some values will be degenerate. But I have strong priors for the real application, so I hope to regularize the model that way
I would imagine the code would look something like this:
def model(x, w, y): x_noise_lvl = numpyro.sample('x_noise_lvl', Normal(0, 5)) w_noise_lvl = numpyro.sample('w_noise_lvl', Normal(0, 2)) return numpyro.sample('obs', dist.Normal(x, x_noise_lvl).T @ dist.Normal(w, w*w_noise_lvl) , obs=Y)
However, I’m not sure how to do math with distributions in pyro. I’m also happy to use PyTorch based pyro, it doesn’t need to be numpyro.
Is this doable?