Reparameterization, lower and upper constraints for variables (MCMC)

I’m trying to reparameterize truncated distributions. I have tried to use LocScaleReparam but the truncated distributions are not left with a loc parameter.

More generally put, I am trying to constrain variables to be between 0 and 1 but sampled from a normal. So far I’ve tried to just sample from the normal and apply jnp.clip to the samples, and also wrapping the distributions with dist.TruncatedDistribution.

The model I am trying to adapt from a stan implementation defines a lower and upper bound when defining the variables. Is there perhaps a numpyro equivalent to writing vector<lower=0, upper=1>[N] latent_var_name; in stan?

I’ve tried to use the truncated distributions (which works) but then the only sensible reparameterization I found I could use was neural transport and the SVI training of the guide does not really converge.

Does anyone have ideas on this one? Would appreciate any input.

1 Like

Why not use a Beta distribution for that variable?

I am trying to port a stan model to numpyro and the stan model uses only normal and cauchy distributions, so I would prefer to stick with that. This is the model I’m trying to reproduce in numpyro: OSF | 05_MBRL_without_inertia.stan

The stan documentation calls the lower and upper bounds for variables “constraints for a container data type”. I’m wondering what the equivalent to that would be in numpyro.

it might help to look at this PR that includes a tutorial about truncated distributions

1 Like