Methods
This page describes exactly what the simulator does. The full source code is in the
GitHub repository;
the model itself is a single file, js/model.js, which is the same code
your browser runs and the code used for calibration.
Why a simulation rather than a formula?
A simple ratio, occupancy = beds needed ÷ beds available, gives the average occupancy but says nothing about how often hospitals run out of beds. Patients do not arrive evenly: demand varies by hour, weekday and season, and lengths of stay vary enormously. Running out of beds happens on the busy days, so the average hides the problem. A discrete-event simulation reproduces that variation and counts the consequences: waits for a bed and lost planned admissions. The simple ratio is still shown as a check on the Validation page.
Model structure
Beds
- Physical beds (
B): general & acute beds open overnight in England (NHS England KH03 definition, which excludes maternity, mental health, learning disability and day-only beds). - Available beds =
B × min(1, staffing%). A bed without nurses to staff it cannot be used. At 100% staffing every physical bed is available, which is the baseline assumption because KH03 counts beds that are open. - Winter escalation: an extra percentage of beds open from 1 December to 31 March.
- Effective bed pools. In reality beds are divided between ~120 acute trusts, and within each trust between wards,
specialties and single-sex bays. A patient cannot use a free bed in another hospital, and often not in another ward. The model represents
this by splitting available beds into independent pools of size
S; each simulation run models one pool with1/(B/S)of national demand, and results are scaled back to England. Smaller pools mean less sharing, so more waiting at the same average occupancy.Sis not observable, so it is calibrated (see below). Results are shown for two values: "today's system" (S fitted to 2025/26 waits) and a "more flexible system" (S fitted to 2018/19, see below).
Emergency patients
- Arrivals: a Poisson process whose rate in hour
hof daydisλ(d,h) = (A / 365 / pools) × season(d) × weekday(d) × hour(h) / 24 season(d) = 1 + a × cos(2π (day-of-year − 15) / 365) (peak mid-January; a = 4% × winter-peak setting)
whereAis emergency admissions per year. The weekday profile is 1.10, 1.03, 1.00, 1.00, 1.02, 0.93, 0.92 (Mon to Sun) and the hour-of-day profile peaks at midday-afternoon (both normalised to average 1; seeHOURLYandWEEKDAYin the code). These shapes are assumptions informed by typical A&E patterns. - Same-day patients: a share leave within 3 to 10 hours (same day emergency care) and are never in a bed at midnight. The share is fitted so that the share of emergency admissions with no night in hospital matches Hospital Episode Statistics ("zero bed day cases", 2023/24, general and acute care). Patients who arrive late in the evening can pass midnight before going home, so the model's same-day group is larger than that share. Stays are counted per admission, as defined by the Health Foundation ("Longer hospital stays and fewer admissions", 2023), not per consultant episode as in HES's own "mean length of stay".
- Length of stay for the rest: lognormal,
LOS = median × mage × (1 + LOS change) × eσZ. The age multipliers come from HES bed days per emergency admission by age; the median and spread σ are fitted to occupancy and to the number of patients in hospital for 21 days or more. - Delayed discharge: a share of overnight emergency patients are not discharged once fit and wait a further Gamma-distributed time (for social care, community beds, transport, etc.). The shape and mean of the delay distribution are fitted to NHS England's published Discharge Ready Date delay bands; the share delayed is fitted to the share of discharges that happen after the Discharge Ready Date.
- Discharge process: a patient who becomes medically fit is confirmed ready at the next morning ward round (09:00–12:00; anyone fit after midday waits for the next day's round). That date is their Discharge Ready Date. They leave after the preparation time (medicines, transport, paperwork; 3 hours on average, an assumption) and never after 20:00. At weekends only a share of ready patients are discharged; the rest wait until Monday. That share is fitted to NHS England's weekend/weekday discharge-rate ratio.
- No bed free: the patient joins a first-come-first-served queue and is admitted when a bed frees. Waiting time from arrival to bed is the model's equivalent of NHS England's "decision to admit to admission" wait.
Corridor care
NHS England defines corridor care as care for 45 minutes or more in a clinically inappropriate place. Since May 2026 it has published two counts (experimental statistics). The model represents both:
- Corridor care on wards (NHS count: patients on a G&A ward outside a bed space, at 08:00). In the model these are corridor spaces on wards: trolleys or chairs used only when every proper bed in a pool is full. An emergency patient placed in one has been admitted, so their A&E wait ends, but they do not count as occupying a G&A bed, matching KH03. They move into a proper bed when one becomes free. Planned patients are never placed in them. The number of spaces is fitted so that today's system reproduces the average ward count for May to September 2026 (see calibration).
- Waiting in A&E for a bed: emergency patients with a decision to admit but no free bed or corridor space. They queue first-come-first-served, and their waiting time gives the ">4h" and ">12h" figures (NHS England's decision-to-admit measure). NHS England's count of corridor care in emergency departments is a different measure. It counts patients over each day, includes patients who are never admitted, and excludes those waiting in a proper cubicle. It is therefore used only as a comparison on the validation page, not as a target.
Neither group counts towards bed occupancy, which, like KH03, counts only patients in proper beds. The ward count comes from 2026/27 while the other targets are for 2025/26. The model is compared on the same calendar days.
Planned (elective) overnight patients
- Arrive on weekdays between 11:00 and 15:00 (Poisson), more on Mondays than Fridays: the weekday spread is fitted to the observed weekly pattern of winter occupancy. Stays are lognormal with the mean taken from HES bed days for diagnoses that are mostly planned.
- If no bed is free they wait behind emergency patients; if still without a bed at 20:00, the admission is lost. In reality hospitals plan fewer operations when beds are short, rather than cancelling on the day, so read the "planned admissions lost" figure as planned capacity lost.
How each setting works
The settings are grouped into things policy can change (capacity, public health, hospital flow) and context that it cannot directly change (population, winter severity). Each one changes a specific model input; the "What the model is running" table on the Model page shows the resulting inputs, so you can check every effect.
Hospital capacity
- General & acute beds: physical beds
B. - Nursing posts filled: available beds =
B × min(1, filled%). Extra beds therefore only help if they can be staffed. The model does not include the evidence that low staffing also lengthens stays and worsens outcomes, so staffing effects are, if anything, understated. - Extra winter beds: additional % of available beds from 1 December to 31 March.
- Corridor care spaces on wards: trolleys or chairs outside a bed space, used only when every proper bed is full. The starting value is fitted to NHS England's ward corridor-care count. Setting it to zero removes corridor care on wards, so those patients wait in A&E instead.
- Planned surgery & treatment: scales the number of planned overnight admissions.
Public health
Risk factors change the number of people who need admitting. For a risk factor with prevalence p and relative risk of
admission RR (people with the risk factor compared with people without), the population attributable fraction is the standard
epidemiological formula
PAF = p (RR − 1) / (1 + p (RR − 1))
and changing prevalence from p₀ to p₁ multiplies admissions by
(1 + p₁ (RR − 1)) / (1 + p₀ (RR − 1))
RR is taken from published research or derived from a published count of attributable admissions (the sources are on the Data & sources page). Several risk factors are combined by multiplying their effects, which assumes they act independently. The effect is applied to both emergency and planned admissions.
- Adult smoking rate and adult obesity rate use the prevalence formula above.
- Alcohol harm changes alcohol-related admissions (OHID's "narrow" measure, where alcohol is the main reason for admission)
by the chosen %. Admissions change by
share × change, whereshareis alcohol-related admissions as a share of all admissions. - Flu vaccination uptake (65+): influenza admissions are simulated as a separate winter wave (a bell-shaped curve
peaking in early January), sized so the model reproduces the observed peak number of flu patients in G&A beds. Vaccination protects the
people vaccinated, with vaccine effectiveness
VEagainst hospital admission. With a sharesof flu admissions in people aged 65+, changing uptake fromu₀tou₁multiplies flu admissions bys × (1 − VE·u₁)/(1 − VE·u₀) + (1 − s)
This counts only direct protection. Vaccination also reduces spread to others, so the real benefit is likely to be larger. Vaccine effectiveness varies a lot from season to season with how well the vaccine matches circulating strains. The "severity of the flu season" setting scales the size of the wave independently of vaccination. - Close the deprivation gap: people in more deprived areas are admitted more often. Each fifth of the population (by
Index of Multiple Deprivation) has a relative admission rate
rq. Closing the gap bygmoves each fifth towards the least deprived:rq' = rmin + (rq − rmin)(1 − g). Admissions change byΣ rq' / Σ rq. The gap partly reflects risk factors, so combining this with smoking and obesity changes double-counts some of the effect.
Hospital flow
- Same day emergency care: share of emergency patients who leave within hours and never occupy a bed overnight.
- Delayed discharges: scales the average time medically fit patients wait to leave. The delay lengths are fitted to NHS England's Discharge Ready Date delay bands. The delays have many causes: in NHS England's discharge sitrep, of patients in hospital a week or more who were delayed, about a quarter were waiting for social care, a third for NHS community services and a fifth for the hospital's own processes. The setting changes all of them together.
- 7-day discharging: share of patients ready to leave at the weekend who leave then; the rest wait until Monday.
- Time from ward round to leaving: average hours between being confirmed ready at the morning ward round and leaving (default 3, an assumption: discharge times are not published nationally). Patients still not ready to go by 20:00 leave the next day.
- Virtual wards / hospital at home: shortens the bed stay of patients aged 75+ by the chosen share.
- Community urgent response for older people: removes the chosen share of emergency admissions in people aged 75+.
- Emergency readmissions within 30 days: starts at the measured rate. In 2024/25, 14.7% of eligible discharges were followed by an emergency readmission within 30 days. Eligible means excluding day cases, maternity, cancer and deaths (OHID Fingertips 41101, from HES). Readmissions are already part of emergency admissions. Each admission also creates discharges that can lead to further readmissions, so with readmission rate r and k eligible discharges per emergency admission (0.99, measured), emergency admissions are proportional to 1 / (1 − rk). Lowering the rate from 14.7% to 12.6%, the 2014/15 level, cuts emergency admissions by 2.4%. The change applies equally to all ages: the national figures are not published by age, although readmissions are more common in older patients. It overlaps with the community response and virtual ward settings, which also prevent some readmissions, so using all three together may double count.
- Length of stay programmes: changes the clinically needed length of stay for all patients.
Population (context)
Emergency demand is built up by age band:
admissions(band, year) = admissions(band, base year) × population(band, year) / population(band, base year)
so admission rates per head are held at base-year levels and only the size and age structure of the population change. Each band has its own length-of-stay and delayed-discharge multipliers (older patients stay longer and are more often delayed). Population comes from ONS mid-year estimates and projections.
Calibration
Most inputs are measured directly (bed numbers, admissions, the age profile, delay lengths, the flu season's timing). The rest cannot be observed, so each is tuned until the model reproduces one measured figure: for 2025/26 where it is published, otherwise the latest available year, as shown in the table. The fitted values and their targets are listed on the Data & sources page.
| Fitted quantity | Measured target |
|---|---|
| Median length of stay | Average G&A occupancy at midnight (KH03) |
| Share of emergency patients going home the same day | Share of emergency admissions with no night in hospital (HES zero bed day cases, 2023/24) |
| Spread of length of stay | Share of occupied beds with patients in hospital 21+ days (daily sitrep) |
| Share of patients delayed once fit | Share discharged after their Discharge Ready Date |
| Weekend discharging | Weekend/weekday discharge-rate ratio (discharge sitrep) |
| Weekday spread of planned admissions | Weekly pattern of winter occupancy (daily sitrep) |
| Size of the flu wave | Peak flu patients in G&A beds (winter daily sitrep) |
| Effective bed pool size | Today's system: share of emergency admissions waiting >12 hours from decision to admit, 2025/26 (A&E). Pre-pandemic flexibility: 2018/19 12-hour waits counted from arrival, converted to the same units (see limitations) |
| Corridor care spaces on wards | Patients in corridor care on G&A wards at 08:00, May to September 2026 (NHS England, experimental) |
Parameters are fitted one at a time by bisection, cycling until all targets are met together (scripts/calibrate.mjs, using the
same model code as this website). Other measurements are kept back to test the model: see Validation.
Public-health effects: which evidence?
This project estimated the effect of smoking, obesity and flu vaccination on emergency admissions from local-authority data
(scripts/effects_analysis.py). The analysis showed that area data cannot isolate these effects: placebo tests fail and some
signs are implausible (see Validation). So by default the simulator uses:
- Smoking: OHID's count of smoking-attributable admissions divided by all admissions in the same age group (HES), with smoking prevalence from the Annual Population Survey, giving the relative risk.
- Alcohol: OHID's count of alcohol-related admissions (narrow measure).
- Obesity: the Million Women Study (relative risk 1.28 for obesity). You can switch to this project's between-area estimate (2.49), which is probably inflated by confounding.
- Flu vaccination: uptake from OHID; vaccine effectiveness against hospitalisation of 42.3% (95% CI 33–50%) in people aged 65+, from a 2024/25 test-negative study in Northern Ireland (England's end-of-season estimate for that age group is not published). The share of flu admissions in people aged 65+ (50%) and their length of stay come from HES.
- Deprivation: age-standardised emergency admission ratios for local authorities grouped into fifths by deprivation score (OHID).
Randomness and accuracy
Each result is the average of many simulated years (30 for "today's system"; for the "more flexible system", whose pools are larger, enough years to simulate the same total number of beds). The baseline and your scenario use the same simulated patients. Arrivals are drawn at a fixed reference rate and thinned to the scenario's demand, and each patient has their own random numbers. A scenario with less demand removes some patients and leaves the rest unchanged, so differences reflect your changes rather than chance. Long waits are much noisier than occupancy, because they depend on rare runs of busy days. The 95% range for the level of today's 12-hour waits is roughly ±2 percentage points of emergency admissions (the ± figure shown on the Model page). Changes are far more precise than that, because the baseline and the scenario share their random numbers: the Model page tests each change run by run and labels it “no clear change” when it is smaller than about two standard errors of the paired difference.
Main limitations
- The pool-size abstraction. No single pool size reproduces both the years before the pandemic and today. Hospitals now generate far longer waits at a given occupancy than a decade ago (see Validation), which is why two systems are shown. Occupancy results barely depend on this; wait results depend on it a lot. The pool size is a catch-all for whatever lengthens waits at a given occupancy, not a measured quantity. Two tests found that discharge delays, stay variability, weekend discharging, flu and corridor spaces cannot explain the change on their own. A ward-level simulation shows that losing the ability to place patients on other wards can produce the change on its own, but that beds blocked by long-stay patients are too small an effect. Trusts with more long-stay patients saw bigger rises in 12-hour waits from the decision to admit, but not in 4-hour waits from arrival. Further tests found that the pre-pandemic level of 12-hour waits from the decision to admit was held down by when decisions were recorded: counted from arrival, 12-hour waits rose about fivefold, not 140-fold. The "more flexible" setting is fitted to 12-hour waits counted from arrival. Its pool size reproduces, in 2018/19's conditions, a 12-hour share (from the decision to admit, the model's measure) equal to 2024/25's share scaled by the fall in 12-hour waits from arrival between 2024/25 and 2018/19 (2.0% against 10.6% of attendances): about 1.6%. This assumes waits for a bed fell in the same proportion as all long A&E stays, which cannot be checked with published data. The fitted pool is about 102 beds; a second pair of years (2017/18 and 2022/23) gives about 109. At that pool size the model gives fewer 4-hour waits in 2018/19 than were observed (about 4.1% against 9.8%, and the 9.8% is itself timed from the decision to admit, so the true figure was probably higher), so it may still overstate pre-pandemic flexibility somewhat.
- Stays are measured from published tables, not patient records. Stays follow the Health Foundation's definitions (per admission, among patients staying at least one night; same-day share separately), but HES's published tables do not split bed days by admission method, so emergency stays are measured on diagnoses where at least 85% of admissions are emergencies. That reproduces the Health Foundation's patient-level figures for 2019 and 2022 to within 2%, but covers only half of emergency admissions. With the same-day share fitted to HES, the model's overnight emergency patients stay about 7.4 nights against 8.8 in HES (validation V6b), and it has slightly too few patients in hospital 7 to 13 days (V6): KH03 occupancy leaves room for fewer bed days than HES records. With each year's own overnight stays and same-day share, past occupancy is back-cast to within about 2 points (V2c).
- Wait effects are probably overstated. In the further validation, the model's 12-hour waits respond to occupancy about five times more steeply than measured within trusts, its winter peak in long waits is about three times too sharp, and it has too few 4-hour waits. Real hospitals have buffers (escalation, moving patients, flexing staff) that a plain queue lacks. Treat changes in waits as upper bounds and changes in occupancy as the firmer result.
- Demand responds to supply in reality. With more beds, hospitals may admit patients they currently treat elsewhere, which would use some of the extra capacity. The model holds admission rates fixed unless you change them.
- National, not local. The simulator treats all trusts as identical. Real pressure is uneven: some trusts are far fuller than average, and fitting a pool size to each trust separately gives a wide spread (median about 70 beds in 2025/26, middle half 38 to 95). Each trust's own pool predicts the order of its later waits far better than the national pool, but not their level precisely (see Validation).
- Simplified patient flow. No transfers between wards, no critical care, no outlying, no paediatric/adult split, no infection-control bed closures.
- Timing of discharges within the day. There is no national data on what time patients leave hospital. The model assumes ward rounds from 09:00 to 12:00 and 3 hours of preparation. Effects of the "time from ward round to leaving" setting therefore rest on that assumption rather than on data.
- Assumed shapes. Hourly and weekday arrival profiles, the lognormal LOS shape and the delay distribution are assumptions; calibration ensures the totals match, not every detail.