sbi icon indicating copy to clipboard operation
sbi copied to clipboard

docs: add a tutorial / how-to-guide for using pyro with sbi

Open janfb opened this issue 9 months ago • 3 comments

We now can use sbi estimators as pyro models (#1491 ) and it would be nice to have a short guide how to do this.

This could be integrated into the tutorial on mnle or trial-based inference (https://sbi.readthedocs.io/en/latest/tutorials/12_iid_data_and_permutation_invariant_embeddings.html)

or a FAQ-like how-to-guide in the form of a code snippet.

janfb avatar Mar 21 '25 09:03 janfb

Is there a place where it would make sense to also document use of a learned posterior as a prior in a Pyro model?

The killer app would be to demo use of a learned likelihood in a nontrivial hierarchical model, which sounds like it might be worth its own tutorial.

sethaxen avatar Mar 21 '25 09:03 sethaxen

As we discussed, a necessary but not sufficient check that things worked well when (specifically, that the learned likelihood is sufficiently accurate in the region of parameter space where Pyro's posterior concentrates) using a learned likelihood in Pyro would be to check that the joint posterior/posterior predictive draws from the Pyro model (generated using Predictive), are consistent with the draws obtained by running the actual simulator conditioned on Pyro's posterior draws.

sethaxen avatar Mar 21 '25 12:03 sethaxen

Is there a place where it would make sense to also document use of a learned posterior as a prior in a Pyro model?

The killer app would be to demo use of a learned likelihood in a nontrivial hierarchical model, which sounds like it might be worth its own tutorial.

In the long run we can add a longer tutorial in Examples showing the general full workflow using a non-trivial hierarchical model, e.g., the "full DDM", where we would cover all those cases, including the predictive checks etc.

janfb avatar Mar 21 '25 13:03 janfb