Hi,
I’m trying to consider weights in my model using pm.Potential(). It works good until I try to run pm.sample_posterior_predictive() on it. It starts and finishes within 1 sec and is just empty.
If I add weights, won’t I be able to sample the posterior predictive?
with pm.Model() as model:
# Data
x_obs_shared = pm.Data('x_obs_shared', x_obs)
group_id_shared = pm.Data('group_id_shared', group_id)
# Hyperpriors for group nodes
alpha_mu = pm.Gamma('alpha_mu', mu = 100, sigma = 50)
alpha_sigma = pm.HalfCauchy('alpha_sigma', beta = 5.0)
beta_mu = pm.Gamma('beta_mu', mu = 100, sigma = 50)
beta_sigma = pm.HalfCauchy('beta_sigma', beta = 5.0)
# Priors
alpha = pm.Gamma('alpha', mu = alpha_mu, sigma = alpha_sigma, shape = n_groups)
beta = pm.Gamma('beta', mu = beta_mu, sigma = beta_sigma, shape = n_groups)
beta_negative = pm.Deterministic('beta_negative', -beta)
sigma = pm.HalfCauchy('sigma', beta = 5.0)
nu = pm.InverseGamma('nu', alpha = 1, beta = 1)
# Expected values
y_est = alpha[group_id_shared] + beta_negative[group_id_shared]*x_obs_shared
# Data likelihoods
logp = weights * pm.StudentT.dist(nu = nu, mu = y_est, sigma = sigma).logp(y_obs)
y_like = pm.Potential('y_like', logp)