Electricity Spot Price Modelling using Weather Data (DK2)

This page presents a small end-to-end data analysis workflow for forecasting electricity spot prices. The objective is to illustrate the performance of a statistical model that predicts the Danish electricity spot price (DK2) as a function of several weather variables, including wind speed, temperature, and solar radiation. The figure on this page shows the model’s predictions compared with the actual spot prices over a two-month validation period. By comparing predicted and actual values, it becomes possible to evaluate how well the model captures short-term price variations and the relationship between weather conditions and electricity prices.

Model and data description

The figure above shows the model performance on a test period from 3 January 2026 to 28 February 2026. This time interval was intentionally excluded from the training dataset in order to evaluate how well the model generalises to unseen data.

The statistical model is based on Ordinary Least Squares (OLS) regression. Several explanatory variables are used to capture patterns in electricity prices, including:

These variables allow the model to capture both weather-driven variations in renewable energy production and recurring temporal patterns in the electricity market.

The model was trained using historical data from 2021–2025. Weather data were collected using the Open-Meteo API, while electricity spot prices were obtained from Nord Pool.

For the test period shown in the figure, the model uses the actual observed weather data for each hour rather than a weather forecast. This means the results illustrate the explanatory power of the model structure itself rather than the uncertainty of weather predictions.

The metrics below summarise performance across the full test period.

Performance dashboard

Period
2026-01-03 00:00 → 2026-02-28 23:00
MAE
0.203 DKK/kWh
RMSE
0.298 DKK/kWh
Bias (mean err)
-0.018 DKK/kWh

Select whether you want to inspect average model error over a day, week, month, or across the full validation period.

Model evaluation

The metrics above summarise the model performance across the entire test period.