Skip to content

Executable examples

Eight small scripts exercise the main workflow families. They are intentionally compact enough to read in one sitting and concrete enough to run as smoke tests.

Foundation

Binary workflow

Simulation → preparation → specification → prior predictive checking.

python examples/binary_workflow.py View source →
Foundation

Duration workflow

Positive-duration simulation and lognormal workflow specification.

python examples/duration_workflow.py View source →
Diagnostics

Predictive diagnostics

Backend-free ROC, precision-recall, and calibration diagnostics.

python examples/predictive_diagnostics.py View source →
Model comparison

PSIS-LOO comparison

Pointwise log-likelihood draws, Pareto-k diagnostics, and descriptive ELPD comparison.

python examples/loo_model_comparison.py View source →
Sensitivity

Sensitivity workflow

Declarative sensitivity planning with automatic model selection and exclusion disabled.

python examples/sensitivity_workflow.py View source →
Reproducibility

Analysis manifest

Capture deterministic fingerprints for data, contract, specification, and transformations.

python examples/reproducibility_workflow.py View source →
Pupillometry

Pupil workflow

Advanced simulation, governed analytic fitting, trajectory prediction, and temporal audit.

python examples/pupil_workflow.py View source →
Environment

Backend status

Inspect optional backend capability and environment state without compilation.

python examples/backend_status.py View source →

Run from a source checkout

PYTHONPATH=src python examples/predictive_diagnostics.py

After installation, ordinary python is sufficient because gp3bayespy is importable from the active environment.

Suggested order

  1. binary_workflow.py
  2. predictive_diagnostics.py
  3. loo_model_comparison.py
  4. sensitivity_workflow.py
  5. reproducibility_workflow.py
  6. pupil_workflow.py

For a guided narrative rather than scripts, continue to the Article library.