# Patient-flow demand and supply (declared before any forecast)

The study's published parts forecast revenue from its drivers (trips and prices; active drivers and their cohorts), and
its third part plans a sales team backwards from a target. In every one of them the recorded sales are the demand. This
part adds a channel between the two: a specialty therapy is shipped to distributors and pharmacies, who hold stock and
dispense it to patients, so shipments are demand plus the change in channel inventory, and supply can run short. The
question: does a patient-flow forecast (patients identified, diagnosed, referred, started and persisting) reconcile with
a forecast that trends the shipments, and where do the two disagree first? No published page has a channel, inventory,
persistence on therapy or a supply limit, or reconciles two forecasts of the same quantity.

It is kept apart from promotion response (no marketing input moves demand here) and from sales capacity (no reps).

The data is explicitly synthetic: a made-up therapy and market, with every rate a labelled assumption in
`protocol-patientflow.json`, chosen as plausible analogue values, not measured from any product. The results are
properties of those assumptions; the method carries, the numbers do not. It stands in for the monthly reconciliation a
demand planning team runs between its patient-based forecast and the shipment trend; it is synthetic so that no
company's data is shared.

This file and `protocol-patientflow.json` were written and committed before any code that forecasts or reconciles
existed. The results files of the published parts are unchanged; this part writes new files only.

What was computed before declaring: the base-case world's expected monthly starts, patients on therapy, dispensed units
and channel inventory, to set a supply limit that binds for a few months without emptying the channel. No forecast, gap
or divergence had been computed.

## 1. The synthetic world (months 1 to 48 after launch)

Each month t, in this order:

1. Patients already on therapy stay on it with probability 1 − h(a), a = months since their start month: h = 8% for
   a = 0, 1 and 2, and 2.5% after.
2. Starts N(t) = 72% of the referrals made in month t − 1 (the rest drop out at the access step).
3. Identified patients (seen by a specialist, not yet diagnosed): 6,000 at launch, 100 new a month; each month 6% are
   diagnosed and 1% leave the pool.
4. Diagnosed, untreated patients: 3,000 at launch, plus the new diagnoses; each month a share r(t) is referred for the
   therapy and 1% leave the pool. r(t) = 5% x adoption(t), adoption(t) = 1 / (1 + exp(−(t − 9) / 2.5)).
5. Patients on therapy A(t) = the survivors plus N(t). Dispensed units D(t) = 0.95 x A(t) (units per patient-month).
6. Channel: the distributors and pharmacies aim to hold W = 6 weeks of demand, I*(t) = (W / 4.345) x max(D(t), L(t)),
   where L(t) = 500 units a month for months 1 to 6 (the launch fill) and 0 after. Shipments S(t) = D(t) + I*(t) −
   I(t − 1), floored at 0 and capped by supply: 900 units a month in months 15 to 18, no limit otherwise. Inventory
   I(t) = I(t − 1) + S(t) − D(t), starting at 0. If inventory cannot cover demand, the shortfall is recorded as unmet.

The base case uses expected values (no chance). The noisy worlds draw every flow: incidence Poisson; diagnoses,
losses, referrals and starts binomial (multinomial where a pool has two exits); survival binomial per start cohort;
1,000 worlds from seed 20261024.

## 2. What the planner sees at the end of month 24

Shipments, channel inventory and dispensed units for months 1 to 24 (dispensed = shipments minus the change in
inventory, which closes exactly in this synthetic world), new starts by month, and patients on therapy by start month.

## 3. The two forecasts of shipments, months 25 to 48

**Shipment trend.** An ordinary least squares line through shipments of months 13 to 24, extended.

**Patient-flow forecast, reconciled to shipments.**

- *New starts:* the planner's funnel, run in expectation from launch with its analogue rates (base: the same rates as
  the world), scaled by the observed starts of months 19 to 24 over the funnel's own starts in those months.
- *Persistence:* each start cohort on therapy at month 24 carried forward with the analogue survival curve
  (conditional on having reached month 24), and each forecast cohort with the full curve.
- *Demand:* patients on therapy times the units per patient-month observed at month 24.
- *Channel plan:* the distributors' contract cuts their stock target to two thirds of its weeks on hand (6 to 4) in
  three equal monthly steps over months 30 to 32; planned inventory is the target weeks times demand, starting from
  the observed inventory at month 24.
- *Reconciled shipments* = demand plus the planned change in inventory, floored at 0 and capped by any supply limit
  ahead (none in the base case).

## 4. Divergence and the bridge

- **Gap:** shipment trend minus reconciled patient-flow shipments, in units and as a percent of the latter.
- **Divergent month:** a forecast month whose gap is more than 5% either way. The **first divergence** is the first
  such month; reported with its size. All divergent months are reported.
- **Bridge:** each month's gap splits into six pieces that sum exactly to it:
  - *inventory and supply in the history:* the shipment trend minus the same trend fitted to dispensed units;
  - *trend fit:* the trend of dispensed units minus a run-rate path, dispensed units at month 24 plus, each month,
    units per patient-month times the recent net change in patients (mean starts minus mean discontinuations over
    months 19 to 24);
  - *new starts:* units per patient-month times the running sum of (recent mean starts minus forecast starts);
  - *discontinuations:* units per patient-month times the running sum of (forecast discontinuations minus recent mean
    discontinuations); this is where the persistence curve enters;
  - *planned inventory:* minus the planned change in channel inventory;
  - *supply ahead:* demand plus the planned change, minus the reconciled shipments (a cap or the floor at 0).
  The piece that explains a month is its largest piece in absolute size. That the pieces sum to the gap is
  bookkeeping, true by construction; another split would name other pieces.
- **History check of persistence:** the planner's analogue survival applied to the observed starts gives a back-cast of
  dispensed units for months 13 to 24; its gap to the observed dispensed units is reported. In the base case the
  analogue equals the world, so the gap is zero by construction; it is reported for the sweeps, where it is not.
- **Money:** the summed gap over months 25 to 48, in units and at an assumed net price of US$4,500 a unit.

## 5. Sweeps and seeds

- **One at a time,** each input in `sweep` at its low and its high value, the rest at base: world inputs (launch
  fill, weeks on hand, the supply limit) change the history; analogue inputs (discontinuation early and late, the
  referral rate, the adoption midpoint) change only the planner's forecast, the world staying at base; plan inputs
  (the destock's size and start) and method inputs (the trend window, the divergence threshold). For each: the first
  divergence (month, size, largest piece), the gap at month 48, the summed gap and the history check.
- **Seeds:** the 1,000 noisy worlds, planner at base: the distribution of the first divergence's month and size, and
  the share of worlds by its largest piece, with Wilson 95% intervals.

## 6. Declared predictions

- **P1.** In the base case the first divergence comes before the planned destock begins (before month 30), and its
  largest piece is a patient piece (trend fit, new starts or discontinuations), not an inventory piece. Supported if
  both hold; not supported otherwise.
- **P2.** Across the 1,000 noisy worlds, the first divergence's largest piece is the same as in the base case in at
  least 80% of worlds. Supported: share 80% or more with a Wilson lower bound of 75% or more. Direction only: share 80%
  or more, lower bound below 75%. Not supported: share below 80%.

Both are reported whatever they show.

## 7. Limits declared before running

- Synthetic therapy and market, assumed rates. The results describe these assumptions; the method carries.
- No truth is scored: the world is not run past month 24, so the page says where the forecasts disagree and why, not
  which is right.
- One channel tier, one stock rule, no returns, expiry, price changes, buy-ins ahead of price changes or seasonality;
  units per patient-month constant; no competitor; no patient restarts after stopping.
- The planner's analogue equals the world in the base case, so the base-case patient-flow forecast carries no
  analogue error; the sweeps move it.

## Frozen-results check

The results file is pinned by sha256 in its tests, and a re-run from the committed protocol, with no network,
reproduces it byte for byte.
