Constraints added to Multivariatenormal

Hello,

Imagine that I have a model with

theta = numpyro.sample("theta", dist.MultivariateNormal(loc = mu, covariance_matrix = cov)

but when I run a MCMC/NUTS I realise that I would like to add some loose constraints like
theta in [bnds_low, bnds_high] to avoid the sampler to spend time far on the tails.

nb. in a determinist point of view the above code would be a gaussian prior on the thetas, and to minimize a likelihood I would have used scipy.minimize with parameter bounds.

What do you suggest? Thanks

see here

@martinjankowiak Thanks for the link.
For a Multivariatenormal then should I use twosidedtruncateddistribution as truncateddistribution is only for univariate distribution?
BTW if you have a snippet that would be great. Thanks

i’m not sure what you should do. i’d suggest switching to a coordinate system in which the MultivariateNormal is diagonal and then truncating in that coordinate system