Dear PYMC3 community,
I am trying to study do a posterior_predictive test of a simple inference problem but the model has 37 dimensions (‘resid’) and I am not sure how to get the 37 posterior_predictive plots. This is my model:
beta_prior = 4
sd_prior = 1
coords = {
'resid': df_3fb5.columns,
'step': df_3fb5.index
}
with pm.Model(coords=coords) as my_model:
mu_fo = pm.Normal('mu_fo', mu=df_5vk6.mean(), sd=sd_prior, dims='resid')
sd_fo = pm.HalfCauchy('sd_fo', beta=beta_prior, dims='resid')
like_fo = pm.Normal('like_fo',
mu=mu_fo,
sd=sd_fo,
#dims='resid',
observed=df_5vk6)
with my_model:
trace = pm.sample(2000, tune=1000, random_seed=RANDOM_SEED)
ppc = pm.sample_posterior_predictive(
trace, var_names=["like_fo"], random_seed=RANDOM_SEED,
)
az.plot_ppc(my_model, var_names=["like_fo"], group='posterior')
The only thing I see with the plot is the ppc of the full data set, not the breakdown per coordinate (resid). If I try to add dim=‘resid’ to the likely_hood I get a shape error saying it expects a shape of 1000 which is the number of data points per coordintes.
Can anyone help me? Thank you very much in advance!
Best,
Sergio