Skip to content
SkilledDragonEngineering Intelligence
MinilabKeylessOctober 21, 2026

SurgeCast recovered 9 of 9 planted demand effects from weather and PM2.5 history

SurgeCast fits daily visits against weather and air-quality history and turns a forecast into staff counts. On synthetic sales for a fictional pharmacy, it recovered every planted effect.

By David Discua

Measured in the lab

9 of 9
planted effects inside 95% CI
70.8%
deviance explained
18.93 / 25.20
holdout MAE, model / baseline
76.8%
80% interval coverage
Model holdout MAElast 56 days18.93
Day-of-week MAEbaseline25.2
  • Keyless fit: 9 of 9 planted coefficients inside the 95% CI
  • Live weather-only fit: 8 of 8 planted terms inside the 95% CI
  • A 5.00 GB dry run refused at the 1.00 GB cap
  • Live extract: 487.0 MB estimated, 487.6 MB actual, under the cap
  • Sales for the fictional pharmacy are synthetic in every run

From reports/surgecast.json · run on October 21, 2026. Keyless: synthetic history, synthetic forecast, fictional pharmacy. Live run in reports/live-run.json: real NOAA GSOD and EPA history for Sacramento, CA, live NWS forecast, synthetic sales

How it is wired

countsdry run, then query7 daysintervalsDaily visits CSVdate, visitsBigQuery publicGSOD + EPA PM2.5NWS forecastkeyless, US onlySurgeCastPoisson fit + holdoutStaffing planp90 / capacity

01/03Your daily visits join weather and PM2.5 history by date.

SurgeCast is a CLI that asks whether hot, rainy or smoky days moved a clinic's, pharmacy's or shop's daily visits, and how many people to staff next week. It joins your daily counts with NOAA weather and EPA PM2.5 history from BigQuery public datasets, fits an explainable Poisson regression, and turns the coming week's forecast into staff counts with prediction intervals. We planted known effects in synthetic sales for a fictional business, Example Corner Pharmacy in Sacramento, CA, and the fit put all 9 inside its 95% confidence intervals. Every sales number is synthetic, and a coefficient only says demand moved with a condition in that history.

The catch

The keyless run uses synthetic history and a synthetic forecast. The live run used real NOAA GSOD and EPA history for Sacramento plus the live National Weather Service forecast, but the sales were still synthetic, generated from that real history with planted coefficients so the fit could be checked against known truth. Nothing here measures a real business.

Coverage limits what the real data can show. Within 30 km of Sacramento, the public EPA PM2.5 table had values for January to May only, 302 of 605 days, so smoke-season effects cannot be estimated for this site. The newest GSOD table ended in August 2025, so the model assumes weekday and weather effects have not drifted since. We looked first for Google's Earth AI environment datasets in BigQuery but could not find public table names, schemas or access steps, so SurgeCast does not query them. The Google Weather, Pollen and Gemini paths were not run live in this lab.

What we ran (keyless)

bun install --frozen-lockfile
bun run demo
bun run report

From reports/surgecast.json, generated on October 21, 2026, on the synthetic fixtures:

MeasurementValue
Sales days / environment days / days used609 / 606 / 589
Deviance explained, full model / day of week only70.8% / 55.6%
Environmental terms vs day of week onlyF(3, 579) = 99.38
Pearson dispersion2.794 (quasi-Poisson)
Planted coefficients inside the fitted 95% CI9 of 9
Holdout MAE, last 56 days, model / baseline18.93 / 25.20
Holdout MAPE, model / baseline12.20% / 14.55%
Holdout 80% interval coverage76.8%
Week of October 26, 2026: expected visits / staff-days1018.0 / 31
BigQuery guard, 5.00 GB dry run vs 1.00 GB caprefused

The live run in reports/live-run.json, also from October 21, 2026, picked the Sacramento Executive Airport station 8.3 km away and returned 605 days of history. The BigQuery dry run estimated 487.0 MB and the real query came in at 487.6 MB, under the 1.00 GB cap. The weather-only model put 8 of 8 planted terms inside its 95% CI, with a holdout MAE of 18.48 against 23.57 for the day-of-week baseline. The weather plus PM2.5 model, on 302 days, put 9 of 9 inside.

How it is wired

The built-in SQL picks the GSOD station with the most days within the configured radius, converts daily max temperature to C and precipitation to mm, and averages EPA PM2.5 daily means over nearby monitors. Every query is dry-run first and refused above the byte cap, and the real query also carries maximumBytesBilled. The model is a log-link Poisson regression on day of week plus heat above 27 C, a rain-day indicator and PM2.5, fitted by IRLS, with quasi-Poisson standard errors when the data are overdispersed. The staffing step draws 4,000 seeded simulations per day and staffs to the 90th percentile divided by visits per person.

Minilab (open source)

SurgeCast has no runtime dependencies and reads public data: bigquery-public-data.noaa_gsod and bigquery-public-data.epa_historical_air_quality.pm25_frm_daily_summary on BigQuery, plus the keyless NWS API for US forecasts. Copy sites/example-sacramento.json for your location, run bun run surgecast env --site <your-site>.json --bigquery --dry-run to see the byte estimate first, then fit against your own CSV with a date and a visits column.

Run it yourself

SkilledDragonCorp/surgecast

Clone, install and run the report with no API keys. The numbers above are what that run writes.

bun install --frozen-lockfile && bun run demo

SkilledDragon is not affiliated with Google LLC, NOAA, the US EPA or the US National Weather Service. Example Corner Pharmacy is fictional and every sales number is synthetic; correlation is not causation. Re-run the report before relying on these numbers. Marks belong to their owners.

All labs