Add example of topological posterior predictive checks with persistent homology#881
Add example of topological posterior predictive checks with persistent homology#881gsidoine wants to merge 8 commits into
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Replaces the placeholder PR number in the Authors section with the actual PR number.
|
I opened this as a draft PR to get feedback on scope, notebook placement, and dependency handling for I am contributing through the GitHub web UI, so I have not yet run the full local pre-commit workflow. However, the Read the Docs preview build for this PR completed successfully, and the notebook now renders after removing the broken widget metadata. The PR addresses proposal issue #880. Happy to revise the notebook structure, location, or dependency notes based on maintainer feedback. |
|
I have updated the notebook metadata/style elements, added the BibTeX references to I have not run local pre-commit because I am contributing through the GitHub web UI, but I am happy to address any formatting or style issues that CI or reviewers identify. |
| @@ -0,0 +1,861 @@ | |||
| { | |||
There was a problem hiding this comment.
I think we can remove the sentence "This is a workflow example, not a proposal to put persistent homology inside the PyMC sampler. "
Reply via ReviewNB
| @@ -0,0 +1,861 @@ | |||
| { | |||
There was a problem hiding this comment.
I think it would be good to add some description on what homology is and why it can be useful (no need to define all the machinery, but the intuition). Maybe some diagrams are enough.
For more advanced users, we should add an appendix describing the concept (why homology? What is the boundary operator? How to compute it?)
Reply via ReviewNB
| @@ -0,0 +1,861 @@ | |||
| { | |||
There was a problem hiding this comment.
for some of these functions we could add doctrings explaining what they do and why are they useful.
Reply via ReviewNB
|
Hi @gsidoine, thanks for the notebook!
I also left some initial comments :) |
Adds homology intuition, docstrings, and appendix material, removes the flagged sentence, and reruns the notebook so figure outputs are included.
Suppresses the harmless Matplotlib tight-layout warning in notebook outputs and updates the paired MyST file to keep the rendered documentation clean.
Suppresses a harmless internal PyTensor runtime warning and avoids ArviZ diagnostics on constant correlation-matrix diagonal entries.
|
Thanks again @juanitorduz for the review! :) I pushed an update addressing the comments:
I also cleaned the warning outputs from the rendered notebook, and the checks are now passed. |
|
Thanks again @juanitorduz and apologies for the delay in getting the pre-commit issue resolved. I ran the pre-commit hook locally on the notebook, paired MyST file, and references file, then committed the generated formatting changes. The local pre-commit run is now passing for The CI checks on the PR now appear to be passing as well Let me know if you need any additional amendments on my end :) |
Addresses #880
This PR adds a new example notebook demonstrating topological posterior predictive checks for PyMC models.
The notebook shows how persistent-homology summaries can be used as posterior predictive discrepancy statistics when the relevant model failure concerns global shape rather than only marginal moments, variance, or autocorrelation.
The example uses a synthetic seasonal time series and compares two PyMC models:
Both models are evaluated using ordinary posterior predictive checks and topological posterior predictive checks computed on delay embeddings of posterior predictive samples.
The main workflow illustrated is:
ordinary posterior predictive checks pass
→ topological posterior predictive checks detect missing global structure
→ model is revised
→ posterior predictive topology improves
The goal is not to add persistent homology as a PyMC dependency, but to show how users can combine PyMC posterior predictive samples with external topology tools such as
ripserfor model criticism.The notebook is currently placed under:
examples/case_studies/topological_posterior_predictive_checks.ipynbI am happy to move it to another section if maintainers prefer a different location.
Helpful links