Predictions for specific values when using model averaging



After averaging three models (see example, I am generating predictions using this code:

ppc_w = pm.sample_ppc_w(traces, 1000, models,

I would like to create counterfactual predictions based on specific values (data), but there is no data argument in the sample_ppc_w function.

Any ideas or suggestions on how to do it??


If you are trying to generate prediction conditioned on some specific input/data, you should set your input as theano.shared variable, and set the new value for prediction before you do pm.sample_ppc_w or pm.sample_ppc. There is an example here:


Cool, thanks!