Demand & Generation Mix
Overview
Electricity prices are fundamentally determined by the supply-demand balance. The EPF pipeline engineers features that capture both the overall demand level and the composition of the generation mix, which determines marginal production costs.
Demand Features
Real Demand
The current peninsular electricity demand in MW, sourced from REE indicator 1293. This is the most direct driver of price: higher demand requires dispatching more expensive generation.
Demand Lags
| Feature | Description |
|---|---|
demand_lag_1h | Demand one hour ago |
demand_lag_24h | Demand at the same hour yesterday |
demand_rolling_24h | 24-hour rolling average demand |
Demand follows strong daily patterns — the 24-hour lag captures “same time yesterday” as a baseline.
Demand Forecast Ratio
demand_forecast_ratio = demand_forecast / demand_lag_24hCompares the official REE demand forecast against yesterday’s actual demand. A ratio > 1.0 signals expected demand growth; < 1.0 signals expected decline. This forward-looking feature captures anticipated demand changes.
Generation Mix Features
Renewable Share
renewable_share = (wind + solar_pv + solar_thermal) / demandThe fraction of total demand met by renewable generation. Higher renewable shares suppress prices because renewables have near-zero marginal cost.
Typical ranges:
- Low renewable: 15–25% (calm, cloudy day) → higher prices
- Average: 35–50% → moderate prices
- High renewable: 60–80% (windy, sunny day) → low or negative prices
Individual Source Shares
| Feature | Formula | Price Impact |
|---|---|---|
wind_share | wind / demand | Strong price suppressor |
solar_share | solar_pv / demand | Daytime price suppressor |
nuclear_share | nuclear / demand | Baseload indicator |
thermal_share | (combined_cycle + coal + cogen) / demand | Cost floor indicator |
Residual Demand
residual_demand = demand - wind - solar_pv - solar_thermal - nuclearResidual demand is the portion of total demand that must be met by dispatchable (typically fossil) generation. This is the key price-setting variable:
- Low residual demand: Only cheap gas or hydro needed → low prices
- High residual demand: Expensive peaker plants dispatched → high prices
- Negative residual demand: Renewable curtailment, negative prices possible
Gas Marginal Indicator
gas_marginal = 1 if combined_cycle_generation > 0 else 0A binary feature indicating whether gas-fired combined cycle plants are running. When gas is on the margin (setting the price), commodity features (gas price, carbon price) become highly relevant.
Interconnection Features
Net Imports
net_imports = france_flow + portugal_flow + morocco_flowPositive values indicate net imports (foreign supply supplementing domestic generation); negative values indicate net exports. Net imports increase available supply, suppressing prices.
Net Import Share
net_import_share = net_imports / demandNormalized to demand level. A 2,000 MW import has a larger price impact when demand is 25,000 MW (8%) than when demand is 40,000 MW (5%).
Price Dynamics Features
Price Lags
| Feature | Lookback | Purpose |
|---|---|---|
price_lag_1h | 1 hour | Short-term momentum |
price_lag_2h | 2 hours | |
price_lag_3h | 3 hours | |
price_lag_24h | 24 hours | Same hour yesterday |
price_lag_48h | 48 hours | Same hour 2 days ago |
price_lag_72h | 72 hours | |
price_lag_168h | 7 days | Same hour last week |
The 24h and 168h lags are the most important — electricity prices have strong daily and weekly autocorrelation.
Rolling Statistics
| Feature | Window | Captures |
|---|---|---|
price_rolling_6h | 6 hours | Recent average |
price_rolling_24h | 24 hours | Daily average |
price_rolling_168h | 7 days | Weekly average |
price_std_24h | 24 hours | Daily volatility |
price_std_168h | 7 days | Weekly volatility |
price_range_24h | 24 hours | Daily peak-to-trough |
Momentum
price_change_1h = price - price_lag_1hprice_change_24h = price - price_lag_24hPositive momentum suggests prices are trending up; negative suggests trending down.
Direct Model-Specific Features
The direct prediction framework adds features known at origin time for each target:
target_hour_price_yesterday = price at (target_hour, yesterday)target_hour_price_last_week = price at (target_hour, 7 days ago)These “same hour” features provide a strong baseline: the price at 14:00 tomorrow is correlated with the price at 14:00 today and last week.