Hi. I am trying to simulate data using the numpyro implementation of the stochastic volatility model, described in the docs. However, when I try to get posterior predictive samples, it just returns observed values. For clarity, here’s the model function below:
def model(returns):
step_size = numpyro.sample("sigma", dist.Exponential(50.0))
s = numpyro.sample(
"s", dist.GaussianRandomWalk(scale=step_size, num_steps=jnp.shape(returns)[0])
)
nu = numpyro.sample("nu", dist.Exponential(0.1))
return numpyro.sample(
"r", dist.StudentT(df=nu, loc=0.0, scale=jnp.exp(s)), obs=returns
)
So, when I try to predict after fitting the model:
...
predictive = Predictive(model=model, posterior_samples=mcmc.get_samples())
samples_predictive = predictive(random.PRNGKey(42), returns)
I just get my observed returns
back.
Am I doing something wrong? Is there a way to actually forward sample it? Thank you!