Build an auditable event-rate report with a predeclared prior, posterior decision rule and queue-level stress checks.
Project: Bayesian monitoring of support escalations
Lock the audit contract
Define one case as one eligible support ticket closed during a fixed intake period, with a seven-day escalation window. Exclude cases whose window has not matured, and deduplicate reopened tickets by the approved case identifier. Use a 47-case mature audit with six escalations as the fixture. Divide it into North, four of six, and South, two of 41, so group totals reconcile to the overall count. Cohort definitions remain visible in every report.
Review the prior before labels
Declare Beta(3, 27) from an earlier comparable period and test its implied distribution over 47-case audit counts. Compare with a weaker Beta(1, 9) prior sharing the same mean. Save both choices and the reason for preferring one before current escalation labels are opened. Predictive checking is part of the project record, not a retrospective story.
Update with reconciled counts
Compute Beta(9, 68) for the overall cohort and group posteriors separately. Assert that 6 + 41 equals 47, that the group event totals equal six, and that processing two batches reaches the same posterior as a combined update. Store batch IDs to make retries idempotent. The update lesson gives the arithmetic and its assumptions.
Publish decision uncertainty
For the overall rate, report the posterior mean, an equal-tail 80% credible interval, and probability that the rate exceeds a predeclared 15% review trigger. Show how this probability moves under the weaker prior. Compare North and South with denominators and intervals rather than point-estimate ranks. The interval lesson keeps parameter and future-count uncertainty distinct.
Audit model fit and operational choice
Simulate future audit counts from the posterior and compare with the next matured period. Check whether North’s high event count is plausible under the shared prior; investigate policy or case-mix changes before relying on shrinkage. Release a short decision note with staffing action, assumed costs, data snapshot, prior version and unresolved limits. Shared-prior limits govern the queue interpretation.
Implementation
def reconcile_audit(group_counts, expected_cases, expected_escalations):
audited = sum(cases for events, cases in group_counts.values())
escalated = sum(events for events, cases in group_counts.values())
if any(not 0 <= events <= cases for events, cases in group_counts.values()):
raise ValueError("invalid group counts")
if (audited, escalated) != (expected_cases, expected_escalations):
raise ValueError("group totals do not match the audit")
return 3 + escalated, 27 + audited - escalated
posterior = reconcile_audit({"North": (4, 6), "South": (2, 41)}, 47, 6)
assert posterior == (9, 68)Performance and operating cost
Reconciliation over G groups costs O(G) time and O(1) extra space. Posterior simulation with S draws costs at least O(S); sorting draws for intervals costs O(S log S). Most project effort is checking case identity, outcome maturity and prior applicability.
Common Mistakes
- Do not update with unresolved seven-day outcomes.
- Do not count reopened cases twice.
- Do not present shared-prior shrinkage as proof that queues have the same true rate.
Read next
- Prior predictive checks for a binary service rate
- Beta-binomial updating with an auditable case count
- Posterior intervals and threshold decisions
- Shared priors, shrinkage and the limits of fixed pooling
Continue the workflow: Project: check a Bayesian support-rate model before acting.
Continue the workflow: Project: review a prior-sensitive helpdesk escalation decision.
