README.md 1.8 KB

Synthetic constrained Bayesian reproducibility example

This example runs the constrained Bayesian workflow on generic positive x values and binary y outcomes. The predictor is not on the SUV scale and has no clinical interpretation. The example checks software execution and reproducibility; it is not statistical or clinical validation.

The complete workflow can be run either as a script or as a clean notebook:

python examples/bayesian_synthetic/run_synthetic_bayesian.py
  • synthetic_bayesian_notebook.ipynb runs data generation, model fitting and goodness of fit, interval and band estimation, elasticity, and measurement noise propagation.
  • run_synthetic_bayesian.py runs the same stages from the command line.

The fixed random seed reproduces the same data and results. Generated tables and figures are written to examples/bayesian_synthetic/outputs/. Replication counts and the output directory can be changed through the environment variables defined near the top of the script.

MCA diagnostic

bayesian_mca_repeated_simulation.py is a separate numerical diagnostic. It generates data under three controlled conditions and repeatedly evaluates the Monte Carlo approximation (MCA). The accompanying CSV files contain the replicate-level results and their summary; the two PDF files show the three-source diagnostic and representative pointwise bands.

The diagnostic shows that MCA behavior depends on how strongly the data identify the constrained model parameters. MCA propagates a stabilized local Gaussian approximation around the MAP estimate. It is therefore retained as a local approximation and should not be interpreted as full posterior inference. Wide MCA intervals or bands are reported rather than tuned away. NPBS and PBS provide complementary refitting-based uncertainty assessments.