Working example 06 Bayesian change-point analysis

Repeatedly unsuccessful approaches

“We have tried several solutions, but the problem keeps returning.”

An online retailer has made three fixes to complaint handling in two years. Each seemed to work, then complaints returned. The team is planning a fourth fix.

The business context

The problem and the solution

The business problem

An online retailer keeps changing its complaint-handling process. Complaints fall after each change, then return. The team needs to know whether its fixes helped or whether it is tackling the wrong part of the business.

How the solution helps

The solution compares complaints with order volume, so a busy period is not automatically treated as worse service. It looks for a lasting change in the complaint rate, checks the periods around previous fixes and compares the timing with an operations log. Matching dates suggest what to investigate; they do not by themselves prove the cause.

Explore the evidence

The input dataset

104 synthetic weekly observations plus a dated log of fixes and operational events. Orders are stored in thousands, so complaints divided by this field gives complaints per 1,000 orders. Generating a new history replaces the observations. The hidden rate used to generate complaints is excluded because a real investigation would not know it.

All records are illustrative and generated in your browser. Browse every row using the table controls. Displayed decimals are rounded; calculations use full precision.

How it works

The method in three steps

  1. Re-examine the measureRaw complaint counts move with order volume. Dividing by orders tests whether the underlying problem has really changed.y_t ~ Poisson(λ · e_t), e_t = 1 or orders_t
  2. Test each fixFor each fix, compare a model where the rate changed on that date with one where it did not, using the weeks either side.BF = p(y_before) · p(y_after) / p(y_before ∪ y_after)
  3. Search for the real changeThe conjugate Gamma prior gives an exact posterior over the week in which the level changed.p(τ | y) ∝ p(y₁…y_τ) · p(y_τ₊₁…y_T)

Try it

The working example

Analysis settings

Measure

Operational event log

Week 14Price list updated
Week 40Warehouse system upgrade
Week 66Switched to a new courier
Week 90New packaging supplier
Most likely change–
Evidence for a change–Bayes factor against no change at all
Fixes that worked–

Two years of complaints

Fixes are marked in purple; the detected change point in navy.

When did the level change?

Posterior probability for each possible change week.

Did each fix work?

Comparison of the weeks before and after each fix.

FixChangeBayes factorEvidence

Interpretation

From example to engagement

What the example shows

When fixes are triggered by spikes, the next measurement is almost always lower: spikes are, by definition, unusual. That makes every fix look effective. Measuring the right thing removes the illusion, and a change-point search points to a cause nobody was investigating.

With real data

  • Incident logs, volumes and an honest timeline of operational changes.
  • Multiple change points, seasonality and covariates through Bayesian structural time-series models.
  • Process walk-throughs to test whether the statistical signal makes operational sense.