PyMC3 posterior prediction example; how to incorporate a matrix of betas?

Thanks for the info; definitely will!

One last question if you might entertain me with is on predictions:

If I want to try to add some out-of-sample data, I am running into dimension issues:

# Predictions
new_data = np.array([0.25, 1.25, 0.33])

with sk_lm:
    pm.set_data({ "treatment_data": new_data[:, None] })
    predictions = pm.fast_sample_posterior_predictive(lm_idata)
    res = az.from_pymc3_predictions(predictions,
                              idata_orig=lm_idata,
                              inplace=False)

Error translating constant_data variable treatment_data: conflicting sizes for dimension 'obs_id': length 3 on the data but length 100 on coordinate 'obs_id'

1 Like