ALLSHIFT/docs/02-specifications/forecasting-requirements.md
pepe 72dd781dbc Organize documentation into docs/ and superseded/
Audit every document in the repository, convert the non-markdown ones into
markdown reports, and split current documentation from outdated material.

docs/ — 31 markdown documents in seven numbered sections. Twenty are new
reports generated from .docx / .pdf / .xlsx / .mlx / .m sources that were
previously unreadable in the browser and undiffable in git. Each report
carries a provenance block (source path, format, MD5) and links back to its
original; all 13 recorded checksums verify against the files on disk.
Machine-extraction losses (PDF table column interleaving, Word OMML
equations, embedded figures) are called out explicitly rather than silently
smoothed over.

superseded/ — outdated material with a documented reason per entry:
two byte-identical ClickUp re-exports, an older revision of the BIDMC/UCSD
energy-flow doc (the retained copy adds the SoC Violation Rate KPI), a
duplicate of Shift input data.docx, the May 2026 simulation plan, the
root PV+Battery.md now covered by a fuller report, GitHub's stock
demo-repository template, and a zero-byte placeholder. Its README also
records what was deliberately NOT retired and why — the "Old Frameworks"
and "Old Simulations" folders hold unique Simulink revisions, and
"Big Ugly Folder" holds the only copy of framework revision 1.3.

Findings worth flagging, all documented in the reports:
- Simulink lineage recovered from each .slx's internal coreProperties.xml
  revision counter. The current model is
  Current Framework/Bobert0206_Initial_Simulation_Framework.slx (rev 2.7);
  the top-level copy is rev 1.3, five revisions behind.
- Simulations/Constants.m is a truncated byte-prefix of the Current
  Framework copy, silently missing H2_leak, H2_cap and E_H2_vol_h.
- The PEM electrolyser and fuel cell are unmodified MathWorks Simscape
  examples still at vendor defaults; the "10x bigger" sizing TODO recorded
  in Constants.m was never carried out.
- controller-claude.m does not compile — undefined P_Electro_max, outputs
  unassigned on several paths.
- The specification set uses two incompatible variable naming conventions
  and disagrees on action-space size (5 vs 16).
- MA_hourly_load.csv (13.7 MB) is the same 35,040 rows as 89993-0.parquet
  (2.4 MB).
- Clinical data is the MIMIC-IV *demo* (ODbL, 100 patients), not full
  MIMIC-IV — redistributable, but the licence and citation are unrecorded.

Housekeeping: untrack 21 Simulink build artefacts (slprj/, *.slxc) and add
ignore rules for them. Root README rewritten around the new layout.

Recruitment notes naming individual candidates are excluded from version
control via .gitignore rather than committed; the generic question template
is kept in docs/07-team-and-operations/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 21:20:33 -07:00

252 lines
18 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Forecasting Requirements
> **Markdown report of a non-markdown source document.**
>
> | | |
> |---|---|
> | **Source** | [`docs/_originals/Forecasting requirements.pdf`](../_originals/Forecasting%20requirements.pdf) |
> | **Format** | PDF, 10 pages, 434 kB |
> | **MD5** | `44db223db7d9301f20dff25b4ab360de` |
> | **Owner** | AI & Control Systems cluster |
> | **Status** | Current — the authoritative forecasting spec |
> | **Report generated** | 2026-07-25 |
> [!NOTE]
> Tables in the source PDF interleave columns when extracted mechanically. The tables below are
> **reconstructed** from the source content. Where the original author marked a judgement as
> AI-generated rather than their own, that attribution is preserved.
## Scope
Specifies three forecasters that feed the simulator's exogenous inputs
(`G(t)`, `L_crit(t)`/`L_noncrit(t)`, `price(t)` — see
[Simulator I/O Interface §2.1](simulator-io-interface.md#21-exogenous-time-series)):
1. **PV generation forecasting**
2. **Hospital electricity demand forecasting**
3. **Day-ahead electricity price forecasting**
---
## 1. PV generation forecasting
### 1.1 Inputs
Most studies show global solar irradiance is the dominant factor; cloudiness, temperature, wind
speed and humidity are the next most important weather variables. Solar position is also usable.
| Category | Features | Notes |
|---|---|---|
| **NWP forecasts** (primary) | Forecast global irradiance (GHI), DNI, DHI; 2 m temperature; cloud fraction; wind speed; relative humidity | KNMI HARMONIE-AROME model; 2 km resolution; updated hourly |
| **Solar position** | Solar zenith angle, azimuth angle | Computed via `pvlib`; adding these reduced RMSE by **13.1%** in [1] |
| **Clear-sky index** | Actual GHI / clear-sky GHI | Normalises seasonal/diurnal trends; stabilises model variance |
| **Historical PV lags** | t96 (same time yesterday), t672 (same time last week) | Valid lags at forecast issuance time |
| **Calendar features** | Hour of day, day of year, month, `is_weekend` | Cyclical encoding avoids discontinuities at midnight/year-end |
| **Panel system config** | Tilt angle (35°), azimuth (180° south-facing), system size (~100 kWp), panel temperature coefficient | Fixed inputs; used to calibrate `pvlib` simulations |
> [!WARNING]
> The lags `t96` and `t672` are **15-minute-resolution** lags (96 steps = 24 h, 672 steps =
> 7 days). The rest of the project — and the simulator's default `dt` — assumes **hourly**
> steps, where the same lags would be `t24` and `t168`. Resolve which resolution the PV
> forecaster targets before implementing.
### 1.2 Models
Tree-based ensembles — Random Forest, XGBoost, LightGBM — are computationally efficient
baselines. A 2022 benchmark comparing 24 ML models across 16 PV plants at 15-minute resolution
confirmed they are competitive after proper hyperparameter tuning [1]. However, they forecast
each timestep independently, ignoring temporal dependencies across the 96-step output sequence.
For the primary model a sequence-to-sequence architecture is recommended. Hybrid
CNN-LSTM-Transformer models show state-of-the-art accuracy for day-ahead multi-step PV
forecasting: Kim et al. [2] showed a combined LSTM-Transformer model outperformed a standalone
LSTM by **48.3%** in MAE. A 2024 systematic review in *Heliyon* confirmed Transformer-based
architectures achieve the best accuracy on PV forecasting tasks [3].
**Recommended stack:**
| Model | Role |
|---|---|
| LightGBM or Random Forests *(author's preferred choice)* | Fast, interpretable baseline; also used in the production ensemble |
| LSTM or GRU | Captures intra-day temporal dependencies |
| Temporal Fusion Transformer (TFT) | Best multi-horizon architecture with native probabilistic output |
| **Ensemble** (simple average of LightGBM + TFT) | Consistently reduces error versus any single model |
Further model comparisons: see [1.1] and [1.2].
### 1.3 Metrics
| Metric | Role | Notes |
|---|---|---|
| nRMSE (% of capacity) | Primary | Normalised by installed capacity; enables comparison across systems |
| MAE (kW) | Primary | Robust to outliers; most intuitive for operations |
| Forecast Skill Score | Essential | `SS = 1 RMSE_model / RMSE_persistence`. Values > 0 indicate improvement over smart persistence |
| MBE | Secondary | Detects systematic over- or under-prediction bias |
| CRPS | Probabilistic | Continuous Ranked Probability Score; evaluates the full predictive distribution |
---
## 2. Hospital electricity demand forecasting
### 2.1 Inputs
| Category | Features | Availability |
|---|---|---|
| **Historical load** | Hourly/15-min lags: t1, t24, t168 (same time last week); rolling 24 h and 168 h statistics *(needs further discussion)* | *"God help us (maybe we can go and measure ourselves IDK)"* |
| **Weather** | Outside temperature **(most important)**, relative humidity, wind speed, global solar radiation *(relative importance needs more research)* | KNMI |
| **Calendar** | Hour of day, day of week, weekend, Dutch public holidays, school holiday periods | *"This should be easy"* |
| **Operational info** | Shift schedules, elective surgery schedule binary (on/off) | *"Got to beg for this I guess"* — recommended by AI, purpose unclear to the author |
> [!IMPORTANT]
> Historical hospital load is flagged here as the single biggest data risk, and it is not yet
> resolved. See [BIDMC dataset work](../03-energy-management/) — the current proxy is the
> [NREL ComStock hospital load profile](../03-energy-management/bidmc-parquet-load-data-manual.md),
> not measured BIDMC data.
### 2.2 Models
For 24-hour-ahead multi-step forecasting, the Temporal Fusion Transformer is the primary
recommendation. TFT processes static metadata, known future inputs, and past-observed variables
through separate attention pathways, and natively supports quantile regression for
probabilistic output [6] — important for RL because of uncertainty. Multiple building-energy
studies confirm it outperforms standalone LSTM at short-term multi-step load forecasting. A
directly relevant 2025 study used LSTM forecasting combined with PPO reinforcement learning for
a **1,500-bed hospital microgrid** and reported strong performance [7].
Ensemble methods such as boosted trees and random forests are reasonable baselines but have no
native sequence modelling. Classical linear time-series methods generally perform worse, though
SARIMAX is attractive as it is far less computationally expensive than TFT or LSTM.
| Model | Strengths | Weaknesses | Verdict *(AI-generated, per author)* |
|---|---|---|---|
| **Temporal Fusion Transformer (TFT)** | Handles mixed input types; native quantile output; interpretable attention | Higher training complexity (too much compute needed) | **Primary model** |
| **LightGBM / XGBoost** | Fast, interpretable, competitive on tabular data | No native temporal sequence modelling | Ensemble component and baseline |
| **SARIMAX** | Statistically rigorous; handles seasonal patterns | Cannot capture non-linear relationships | Baseline benchmark |
| **CNN-BiLSTM** | Captures local and bidirectional temporal patterns | Needs more tuning than TFT | Optional comparison model |
### 2.3 Evaluation and metrics
Evaluation **must** use rolling walk-forward cross-validation — not random train/test splits —
to preserve temporal ordering and prevent data leakage. Test data should span **at least four
full seasons**. Always report forecast skill relative to a naive same-weekday-same-hour
persistence baseline.
| Metric | Role | Target / note |
|---|---|---|
| MAPE (%) | Primary | |
| CV-RMSE (%) | Primary | Target **< 5%**; minimum acceptable **< 10%** for 24 h-ahead hourly forecasts |
| | Secondary | Target **< 20%** (hourly); ASHRAE Guideline 14 threshold for model calibration |
| R² | Bias check | Target **> 0.95**; intuitive variance-explained measure |
| NMBE (%) | | Normalised Mean Bias Error; target **±5%**; flags systematic over/under-prediction |
| Peak MAE (kW) | Operational | Accuracy specifically during morning and evening demand peaks |
---
## 3. Day-ahead electricity price forecasting
### 3.1 Inputs
Feature selection for Dutch electricity price forecasting is well established. The strongest
predictor is the price itself — autoregressive lags dominate — while renewable generation
forecasts provide the key exogenous signal.
| Feature category | Specific variables | Source |
|---|---|---|
| **Autoregressive price lags** | All 24 hours from days d1, d2, d3, d7 (**96 lags total**); constitutes the core of the LEAR model | ENTSO-E Transparency Platform |
| **Renewable generation forecast** | Wind generation forecast (onshore + offshore separately); solar PV forecast. In 2024 wind contributed ~27% and solar ~18% of Dutch generation. Correlation with price: **r = 0.84** | ENTSO-E Transparency Platform |
| **Load forecast** | Day-ahead total electricity demand forecast for the Netherlands bidding zone | ENTSO-E Transparency Platform |
| **Fuel price** | TTF natural gas spot price (Dutch Title Transfer Facility): the marginal cost signal for gas-fired generation (~34% of Dutch generation) | ICE Futures Europe |
| **Carbon price** | EU ETS CO₂ allowance price; affects marginal cost of fossil generators | ICE / Trading Economics / Investing.com |
| **Cross-border flows** | Net scheduled import/export with Germany (NL-DE), Belgium (NL-BE), UK, Norway. The Netherlands has **> 9 GW** interconnector capacity | ENTSO-E Transparency Platform |
| **Calendar features** | Hour of day, day of week, `is_weekend`, Dutch public holiday flags | *"Obvious"* |
### 3.2 Models
The electricity price forecasting (EPF) literature has converged on a clear hierarchy, anchored
by the benchmark work of Lago, Weron and collaborators [8][9].
The **LEAR** model (LASSO-Estimated AutoRegressive) is the gold-standard baseline: 96
autoregressive price lags (all 24 hours from days d1, d2, d3, d7) plus exogenous regressors,
with LASSO regularisation for automatic feature selection. Many complex deep learning models
fail to outperform LEAR despite orders of magnitude greater computational cost, making it an
essential benchmark.
Deep neural networks with 24 (or 96) joint outputs and **NBEATSx** — NBEATS extended with
exogenous variables by Olivares et al. [10] — improve on LEAR by roughly **520%**. The TFT
shows strong results for probabilistic price forecasting [11]. The most consistent finding
across the EPF literature is that **ensemble averaging of 24 models reliably outperforms any
individual model** [8].
| Model | Strength | Weakness | AI verdict |
|---|---|---|---|
| **LEAR** | Fast, interpretable, strong baseline; well studied for EU markets | Linear; cannot capture non-linear price-spike dynamics | Essential baseline — always implement first |
| **NBEATSx** | ~20% improvement over NBEATS; strong exogenous handling | Higher implementation complexity | Strong alternative to DNN |
| **DNN (24-output)** | Captures non-linearities; modest improvement over LEAR | Requires hyperparameter tuning; less interpretable | Recommended primary DL model |
| **Temporal Fusion Transformer** | Native quantile forecasting; handles mixed inputs | Heaviest architecture | Recommended for probabilistic forecasts |
| **Ensemble (LEAR + DNN + TFT)** | Consistently best overall accuracy | Requires all three models to be maintained | Recommended production deployment |
> Models must be recalibrated **daily** using a rolling **730-day** training window to capture
> evolving market dynamics. All test sets must span at least one full year: the 20222023 energy
> crisis fundamentally altered Dutch price distributions, and models trained exclusively on
> pre-crisis data fail to generalise.
### 3.3 Metrics
| Metric | Role | Notes |
|---|---|---|
| MAE (€/MWh) | Primary | The standard metric in EPF literature; robust to outliers and sign changes. Typical range: **28 €/MWh** in normal market conditions |
| RMSE (€/MWh) | Secondary | Penalises large errors (spikes) more heavily than MAE; useful for tail-risk assessment |
| rMAE | Relative benchmark | Relative MAE versus the naive same-day-last-week persistence benchmark; enables cross-market comparison |
| Diebold-Mariano test | Statistical significance | Use the multivariate DM test (Ziel & Weron, 2018) for a single significance statistic over the full daily output vector |
### 3.4 Challenges
Structural features of the Dutch market that make price forecasting harder than demand or PV:
- **Negative prices are now routine.** Rapid growth of offshore wind (Hollandse Kust projects)
and rooftop solar creates regular oversupply, especially on weekend afternoons. Standard
models struggle with the resulting bimodal price distribution.
- **Price spikes during scarcity events.** Cold, calm periods (*Dunkelflaute*) with low wind and
solar output can drive prices to the market cap of **€3,000/MWh**. Models must handle
heavy-tailed distributions.
- **Market regime changes.** The 20222023 energy crisis caused a structural break in price
distributions. All models must include sufficient post-crisis training data.
- **15-minute MTU transition (October 2025).** The shift to 15-minute market time units
**quadruples the forecast output dimension from 24 to 96 values per day**, requiring models
that scale efficiently to higher-dimensional outputs.
> [!NOTE]
> The 15-minute MTU transition is described here as forthcoming. As of this report's date
> (2026-07-25) that transition has passed, so it is now a live constraint rather than a
> forward-looking one — and it interacts directly with the simulator's open question about
> whether `dt` should be hourly or sub-hourly.
---
## References
| # | Reference |
|---|---|
| [1] | Mayer, M. J. & Gróf, G. (2022). Extensive comparison of physical models for photovoltaic power forecasting. *Applied Energy*, 324, 119526. DOI: [10.1016/j.apenergy.2022.119526](https://doi.org/10.1016/j.apenergy.2022.119526) |
| [1.1] | Husein M, Gago EJ, Hasan B, Pegalajar MC. Towards energy efficiency: A comprehensive review of deep learning-based photovoltaic power forecasting strategies. *Heliyon*. 2024 Jun 27;10(13):e33419. DOI: [10.1016/j.heliyon.2024.e33419](https://doi.org/10.1016/j.heliyon.2024.e33419). PMID: 39050417; PMCID: PMC11268202 |
| [1.2] | Ahmed, R., Sreeram, V., Mishra, Y., Arif, M.D. A review and evaluation of the state-of-the-art in PV solar power forecasting: Techniques and optimization. *Renewable and Sustainable Energy Reviews*, 124 (2020), 109792. DOI: [10.1016/j.rser.2020.109792](https://doi.org/10.1016/j.rser.2020.109792) |
| [2] | Kim, T. et al. (2024). Day-ahead multi-step PV generation forecasting using LSTM-Transformer hybrid. *Renewable and Sustainable Energy Reviews*, 199, 114479. DOI: [10.1016/j.rser.2024.114479](https://doi.org/10.1016/j.rser.2024.114479) |
| [3] | Al-Rakhami, M. et al. (2024). Deep learning strategies for photovoltaic power forecasting: a systematic review. *Heliyon*, 10(9), e30940. DOI: [10.1016/j.heliyon.2024.e30940](https://doi.org/10.1016/j.heliyon.2024.e30940) |
| [4] | González González, A. et al. (2018). Evaluation of energy consumption in German hospitals: benchmarking in the public sector. *Energies*, 11(9), 2279. DOI: [10.3390/en11092279](https://doi.org/10.3390/en11092279) |
| [5] | Parker, S. A. et al. (2019). Energy consumption analysis and characterisation of healthcare facilities in the United States. *Energies*, 12(19), 3775. DOI: [10.3390/en12193775](https://doi.org/10.3390/en12193775) |
| [6] | Lim, B. et al. (2021). Temporal Fusion Transformers for interpretable multi-horizon time series forecasting. *International Journal of Forecasting*, 37(4), 17481764. DOI: [10.1016/j.ijforecast.2021.03.012](https://doi.org/10.1016/j.ijforecast.2021.03.012) |
| [7] | Ahmad, M. et al. (2025). AI-driven energy management for hospital microgrids integrating LSTM forecasting and reinforcement learning. *Scientific Reports*, 15(1). DOI: [10.1038/s41598-025-28907-5](https://doi.org/10.1038/s41598-025-28907-5) |
| [8] | Lago, J. et al. (2021). Forecasting day-ahead electricity prices: a review of state-of-the-art algorithms, best practices and an open-access benchmark. *Applied Energy*, 293, 116983. DOI: [10.1016/j.apenergy.2021.116983](https://doi.org/10.1016/j.apenergy.2021.116983) |
| [9] | Weron, R. (2014). Electricity price forecasting: a review of the state-of-the-art with a look into the future. *International Journal of Forecasting*, 30(4), 10301081. DOI: [10.1016/j.ijforecast.2014.08.008](https://doi.org/10.1016/j.ijforecast.2014.08.008) |
| [10] | Olivares, K. G. et al. (2023). Neural basis expansion analysis with exogenous variables: forecasting electricity prices with NBEATSx. *International Journal of Forecasting*, 39(2), 884900. DOI: [10.1016/j.ijforecast.2022.01.002](https://doi.org/10.1016/j.ijforecast.2022.01.002) |
| [11] | Jiang, W. et al. (2024). Probabilistic electricity price forecasting using LASSO-TFT hybrid models. *Journal of Forecasting*, 43(5). DOI: [10.1002/for.3097](https://doi.org/10.1002/for.3097) |
Note: references [4] and [5] (hospital energy benchmarking) are listed but not cited anywhere in
the source text.
## Related
- [Simulator I/O Interface](simulator-io-interface.md) — consumes these forecasts as `G(t)`, `L(t)`, `price(t)`
- [PV Hourly Dataset Manual](../03-energy-management/pv-hourly-dataset-manual.md) · [Satellite PV Dataset Manual](../03-energy-management/satellite-pv-dataset-manual.md)
- [BIDMC ComStock Load Profile](../03-energy-management/bidmc-parquet-load-data-manual.md) — the current hospital-demand proxy
- [Work Packages](../01-project/work-packages.md) — WP2 covers the forecasting stack