I am trying to perform prior predictive checks for my extreme value model, but fail to do so with the error mentioned below. I am running Pymc version 3.11.4 and arviz v. 0.11.4.
The model set up is:
def gev_logp(value, loca, sig, xi):
scaled = (value - loca) / sig
logp_xi_not_zero = -(tt.log(sig)
+ ((xi + 1) / xi) * tt.log1p(xi * scaled)
+ (1 + xi * scaled) ** (-1/xi))
logp_xi_zero = -tt.log(sig) + (xi+1)*(-(value - loca)/sig) - tt.exp(-(value - loca)/sig)
logp = tt.switch(tt.abs_(xi) > 1e-4 , logp_xi_not_zero, logp_xi_zero)#1e-4
return tt.sum(logp)
p=1/100
with pm.Model() as model_gev:
loca = pm.Normal('loca', mu=1, sigma=100)
sig= pm.Normal('sig',mu=1, sigma=100)
xi = pm.TruncatedNormal('xi', mu=0, sigma=0.4, lower=-0.6, upper=0.6)
gev = pm.DensityDist('gev', gev_logp, observed = {'value':data, 'loca':loca, 'sig':sig, 'xi':xi})
z_p = pm.Deterministic('z_p', loca - sig/xi*(1 - (-np.log(1-p))**(-xi)))
trace = pm.sample(3000, cores=4, chains=4, tune=2000, return_inferencedata=True, idata_kwargs={"density_dist_obs": False}, target_accept=0.99)
The Inference Data i.e., the Trace contains posterior, sample_stats, and log_likelihood.
I tried to run prior predictive checks with the code below
idata= pm.sample_prior_predictive(samples=1000, model=model_gev)
az.plot_ppc(idata, group="prior", figsize=(12, 6))
ax = plt.gca()
ax.set_xlim([2, 6])
ax.set_ylim([0, 2]);
The error I get is
TypeError: `data` argument must have the group "prior_predictive" for ppcplot