Retracted Analysis

Start with a already trained model (latent) and a complete set of evidences (model input & output), Retracted Analysis is a technique to delete the evidence of one (some) model input(s) of this case, to infer its (their) distribution(s).
Is there a easy way to do it with pyMC3?
Is it requires mathematical manipulation to invert the model (when possible)?
Does it requires retraining against the data for every case?
Thanks!

Do you have a link to a resource where we could learn more about this?

Hi, you can check the following:
https://www.bayesserver.com/docs/analysis/retracted-analysis

In relation to mathematical manipulation to invert the model, I have an example for the “Statistical Rethinking” chapter 4 notebook resources/Chp_04.ipynb at master · pymc-devs/resources · GitHub) Code 4.50 (cell 53).
In this case, you can find the distribution of the input (retract the input), fixing the output and inverting the model as:
weight_at_160=(160.0-trace_4_3[“a”]) / trace_4_3[“b”] + d2.weight.mean()
az.plot_kde(weight_at_160)
plt.xlabel(“weight”)
plt.yticks([]);

If I understand your question correctly, we would need to retrain the model every time here. The difference between bayesserver and PyMC3 is that the former uses a very restrictive class of models which allow for fast computation of these sorts of queries. PyMC, in general, does not have the fast algorithms to do this but allows for expression of a broader class of models. That said, it might be fast enough for your use case to do it in PyMC3.