Inspiration

What if the most accurate forecasting model is also one of the most vulnerable?

As a Statistics undergraduate at , I have studied time-series forecasting, statistical modelling and machine learning. One question inspired me to build GhostForecast: why do we evaluate forecasting models primarily on historical accuracy when real-world environments are constantly changing?

Businesses rely on forecasts to manage electricity demand, inventory, logistics and operational decisions. However, unexpected demand shocks, missing observations and distribution shifts can cause even advanced forecasting models to fail.

Cybersecurity has red-teaming. Engineering has crash testing. Why shouldn't forecasting have its own reliability laboratory?

That is the inspiration behind GhostForecast — The Red Team for Forecasts.

What it does

GhostForecast is an interactive statistical stress-testing platform that deliberately exposes forecasting models to simulated disruptions, helping users discover vulnerabilities before they become real-world problems.

It brings together five distinct forecasting approaches:

  • Seasonal Naive: A simple, interpretable statistical baseline.
  • AutoETS: Exponential smoothing.
  • AutoARIMA: Classical time-series modelling.
  • LightGBM: Gradient-boosted machine learning.
  • Amazon Chronos-Bolt Small: A pretrained time-series foundation model.

Rather than simply asking which model predicts best, GhostForecast investigates which model can remain reliable when conditions change.

Core features

1. Rolling-Origin Backtesting

Evaluates forecasting models using real hourly electricity demand data from New England, with chronological training, calibration and evaluation periods.

2. Statistical Stress Testing

Simulates unexpected outcome shocks and historical data outages, measuring how these disruptions affect forecasting accuracy and uncertainty.

3. Forecast Survival Matrix

Compares five forecasting models across 40 benchmark model-scenario combinations, revealing trade-offs between absolute accuracy, relative deterioration and prediction interval reliability.

4. Automated Vulnerability Search

Instead of manually testing individual scenarios, GhostForecast automatically evaluates combinations of shock magnitudes, forecast windows and forecasting models.

The default search evaluates 175 model-scenario combinations and identifies the smallest tested disruptions that breach a predefined deterioration tolerance. Users can configure larger experiments and inspect the underlying evidence.

5. Conformal Prediction

Evaluates whether nominal 90% prediction intervals remain reliable under simulated stress.

6. Natural-Language Scenario Explorer

Allows users to describe custom stress scenarios in plain English. A deterministic parser converts their instructions into validated statistical experiments, with a structured preview before execution.

7. Statistical Investigator

Transforms computed statistical evidence into understandable findings and model recommendations, with direct links to the supporting experiments.

How I built it

GhostForecast combines statistical research, machine learning and full-stack software engineering.

The frontend uses React, TypeScript, Vite and Plotly to create an interactive forecast intelligence dashboard.

The backend uses Python, FastAPI, StatsForecast, LightGBM and Amazon Chronos-Bolt.

The experimental design includes:

  • 4,033 real hourly electricity demand observations.
  • 28 rolling-origin evaluation folds.
  • A 24-hour forecasting horizon.
  • 672 final evaluation targets per model.
  • 30 separate chronological calibration origins.
  • Lead-specific conformal prediction intervals.
  • Controlled outcome shocks and historical-input outages.
  • Automated vulnerability discovery with traceable statistical evidence.

All five models are evaluated using the same final forecast origins and targets to maintain a consistent comparison.

For the public deployment, computationally expensive model inference is performed offline. The application uses verified saved forecasts and performs interactive stress scoring without requiring a GPU or expensive cloud infrastructure.

This architecture allows GhostForecast to run on a free hosting plan while retaining genuine statistical functionality.

How I used Kiro

Kiro played a meaningful role in developing GhostForecast's automated vulnerability-search system.

Using Kiro's spec-driven development workflow, I defined the feature through structured requirements, technical design and implementation tasks.

Kiro contributed to:

  • Designing the vulnerability-search architecture.
  • Implementing the automated statistical scoring engine.
  • Developing parameter-grid evaluation and validation.
  • Identifying the smallest tested tolerance breaches.
  • Connecting search results to the Statistical Investigator.
  • Integrating interactive vulnerability results into the frontend.
  • Writing regression tests for statistical correctness and edge cases.

The original Kiro specifications are preserved in the repository under .kiro/specs/vulnerability-search/, alongside the implementation history.

OpenAI Codex contributed to the initial application, statistical benchmark, Chronos integration, UI/UX redesign, release engineering and verification.

Together, these tools helped me transform a statistical research idea into a deployed, tested application while maintaining transparent development attribution.

Challenges I ran into

Preventing data leakage

Forecasting experiments can easily produce misleading results when future information accidentally enters the training process.

I addressed this through chronological evaluation, consistent information cutoffs and separate calibration and testing periods.

Designing meaningful stress experiments

A key challenge was distinguishing between unexpected changes in future outcomes and corruption of historical forecasting inputs.

Outcome shocks preserve the original predictions while changing simulated evaluation targets. Historical data outages require forecasts to be regenerated using corrupted historical inputs.

This distinction was essential to producing interpretable results.

Measuring reliability beyond accuracy

A model can have low forecasting error while producing unreliable prediction intervals.

GhostForecast therefore evaluates absolute error, relative deterioration, empirical coverage and interval quality instead of relying on a single performance metric.

Deploying an AI forecasting model with limited resources

Amazon Chronos-Bolt introduces additional computational and memory requirements.

Rather than relying on expensive GPU hosting, I separated offline model inference from interactive public stress testing. This allowed the five-model application to remain compatible with Render's free hosting plan.

Building a usable analytical interface

Presenting hundreds of statistical experiments without overwhelming users was another challenge.

I redesigned the interface around guided exploration, interactive heatmaps, evidence links, responsive layouts and accessible navigation.

Accomplishments that I'm proud of

GhostForecast produced several interesting empirical findings.

Model Clean MAE (MW) Worst Preset MAE (MW)
Seasonal Naive 1,062.75 2,035.23
AutoETS 2,496.69 2,500.63
AutoARIMA 707.02 2,026.76
LightGBM 715.48 1,711.61
Amazon Chronos-Bolt Small 676.44 1,611.04

Amazon Chronos-Bolt Small achieved the lowest clean forecasting error and lowest worst-case absolute error across the five predefined nonzero stress scenarios.

However, even this advanced pretrained model was vulnerable:

  • Its forecasting error increased by approximately 138% during a simulated six-hour historical data outage.
  • Its prediction interval coverage fell from 82.59% to 40.77%, against a nominal target of 90%.
  • It breached its 25% deterioration tolerance in four of the five nonzero predefined stress scenarios.

The automated vulnerability search also discovered that a simulated 5% demand increase across the full 24-hour forecast horizon was sufficient to breach Chronos's deterioration tolerance in the tested grid.

These findings reinforce GhostForecast's central message:

The most accurate forecasting model is not necessarily the most reliable under disruption, and even advanced AI models need systematic stress testing.

I am also proud of delivering:

  • Five distinct forecasting models.
  • 222 passing regression tests.
  • 40 benchmark model-scenario comparisons.
  • 175 default automated vulnerability-search combinations.
  • A responsive desktop and mobile interface.
  • A publicly deployed application.
  • An open-source repository with reproducible statistical methodology.

What I learned

Building GhostForecast taught me that forecasting reliability extends far beyond minimizing prediction error.

I learned how to combine statistical methodology with practical software engineering, design controlled sensitivity experiments, evaluate prediction interval reliability and communicate complex quantitative findings through an interactive interface.

I also learned how to use AI coding tools more effectively through structured specifications, incremental development, regression testing and independent verification rather than relying solely on generated code.

Most importantly, I learned that sophisticated AI forecasting models should not automatically be assumed to be robust simply because they achieve better historical accuracy.

What's next for GhostForecast

I envision GhostForecast becoming a broader reliability-testing framework for forecasting systems.

Future extensions include:

  • Supporting more forecasting models and foundation models.
  • Expanding live analysis of user-uploaded datasets.
  • Testing additional industries and real-world datasets.
  • Introducing correlated disruptions and more complex distribution shifts.
  • Continuous forecasting reliability monitoring.
  • Automated alerts when forecast performance deteriorates.
  • Integration with enterprise forecasting and MLOps pipelines.

The current benchmark represents a retrospective electricity-demand case study. The public demo uses saved forecasts, Chronos's pretraining-data overlap with the benchmark is unknown, and nominal conformal coverage is not guaranteed under distribution shifts.

GhostForecast is a step toward making forecasting reliability measurable, explainable and actionable.

Don't just build better forecasts. Build forecasts you can trust.

GhostForecast — Break your forecasts before reality does.

Built With

Share this project:

Updates

Submission history