How to sample a transformed parameter?

In the following case is it possible to obtain y as transformed sample directly from the sampler? If yes, can you please tell me.

def dist(c):
    mu = numpyro.sample('mu', dist.Normal(0, 1))
    tau = numpyro.sample('tau', dist.Normal(0,1))
    x = numpyro.sample('x', dist.Normal(jnp.full(d,mu), jnp.exp(tau)))
    y = mu + jnp.exp(tau*(1-c))*(x-mu*c)

i don’t see how

I guess you’re looking for deterministic primitive or Delta distribution?

1 Like