Bayesian Statistical Modeling with PyMC
Campus service-center case study: estimate daily demand, model resolution times under an outlier, compare Poisson/ZIP and Gaussian/Student-t models, then turn posterior inference into ROPE, staffing, and SLA decisions.
Live Link
Official project entry points with clean, readable URLs.
Operations Decision Dashboard
Full Executed Notebook Report
https://rohaan2802.github.io/Bayesian_PyMC/notebook-report.html
GitHub Repository
Source Notebook (.ipynb)
Project overview
Completed MT-2002 Assignment 1 notebook with a full professional extension layer for portfolio and viva defense.
Business question
How many requests arrive on a typical day, and how long do selected requests take to resolve?
Data
40 daily request counts and 35 resolution times, including one unusual 42-minute observation.
Method
Bayesian priors, MCMC (2 chains), 94% HDIs, PPC, LOO, ROPE, utility, and calibration tools.
Assignment depth — what was required and what we delivered
Interactive case accordion. Open any case to see the required task and the delivered analysis.
Case 1 — Understanding the data
Classify discrete vs continuous variables, compute diagnostics, and produce exploratory histograms for demand and resolution time.
Case 2 — Poisson demand model
Specify Gamma prior for λ, check prior predictive distribution, sample posterior, report mean and 94% HDI.
Case 3 — Zero-inflated Poisson
Test whether zero-request days need a separate process; compare Poisson vs ZIP with PPC zero-day rates.
Cases 4–6 — Resolution-time models
Fit Gaussian and Student-t models, compare parameters and predictive fit, explain outlier influence of the 42-minute case.
Cases 7–8 — ROPE and integrated decision
Compare μ against a 14-minute operational benchmark using ROPE rules, then write a management-facing conclusion.
Extension Packs A–C — Cases 9–30
Diagnostics, LOO, sensitivity, influence, staffing/SLA tools, PIT calibration, utility optimization, hierarchical weekday proxy, leave-future-out check, and saturation board.
Models fitted
Switch tabs to inspect count models, continuous models, and decision tools.
Poisson(λ)
Gamma(3,1) prior. Baseline daily demand model with posterior λ ≈ 2.955.
Zero-Inflated Poisson
Beta(2,2) on ψ and Gamma on λ. Recovers the observed 20% zero-day rate.
Gaussian
Sensitive to the 42-minute outlier; σ inflates to about 5.2 minutes.
Student-t
Preferred model for typical time: μ ≈ 13.71, σ ≈ 1.36, ν ≈ 2.97.
ROPE
Against 14 minutes, default ROPE [13.5, 14.5] remains undecided.
Utility & SLA
Staff optimum = 4 under relative costs; SLA coverage curves for 12–30 minutes.
Selected numerical results
Values from the executed notebook outputs (seed 2026).
| Quantity | Estimate | Interpretation |
|---|---|---|
| Request mean / variance | 2.95 / 4.82 | Over-dispersion vs pure Poisson |
| Poisson λ posterior | 2.955 · HDI [2.462, 3.490] | Baseline expected daily demand |
| ZIP ψ / λ | 0.793 / 3.570 | Extra zero process improves quiet-day fit |
| Gaussian μ / σ | 14.517 / 5.157 | Outlier inflates center and scale |
| Student-t μ / σ / ν | 13.710 / 1.359 / 2.965 | Preferred continuous model |
| Utility-optimal staff | 4 | Minimum expected relative cost |
Full traces, predictive plots, comparison tables, and discussion are in the HTML report and source notebook.
Visual gallery
Filter by pack or search captions. Headings sit above every screenshot.




































How to run locally
Create a virtual environment, install dependencies, and open the notebook.
python -m venv .venv .venv\Scripts\activate pip install -r requirements.txt jupyter notebook notebook/i222327_A01_A_SM.ipynb