Hello Ricardo. Thank you for the suggestions. Actually, the variables are aligned correctly. After several attempts, I run the code without errors modifying this line in the model definition:
before:
mu = pm.Deterministic("contributions", tt.stack(contributions).T, dims=['all_vars'])
after:
mu = pm.Deterministic("contributions", tt.stack(contributions).T)
That said, I have another element to investigate. Please tell me if I need to open another thread for this.
If I create an out-of-sample loop to sequentially test different values of the model variables with this code:
with model:
pm.set_data({ "control_data": z_test})
idata.extend(pm.sample_posterior_predictive(idata, var_names=["y_hat", "contributions"]))
the output does not change despite changing the input. To make it change, I have to redefine the model from the beginning, run it, and then do the out-of-sample. This is feasible but very time-consuming. Is there any way or command to perform this iteration without starting from scratch? Thank you very much.