Overview
Forecasting day-ahead electricity prices is the practical problem behind a competitive market. Most of the literature assumes stationarity, and the methods that do not tend to address one form of non-stationarity at a time, leaving the common case of several acting at once largely unexamined.
The approach here is a division of labour between two models. An N-dimensional Langevin equation captures the fine-grained structure of prices while the market behaves stationarily. A neural ordinary differential equation is then trained not on the prices themselves but on the difference between the observed series and the trajectories the Langevin equation simulates.
Learning that residual is what reconstructs the non-stationary components the Langevin equation cannot represent. The framework is exercised on the Spanish day-ahead market across several non-stationary scenarios and compared against a range of naive baselines.
The model
The electricity price is decomposed as Sₜ = Xₜ + Yₜ, where Sₜ is the observed 24-dimensional price (one dimension per hour of the day), Xₜ is a multivariate stochastic process carrying the stationary part, and Yₜ is a deterministic, time-dependent function carrying everything the stationary process misses.
Xₜ is built with the same N-dimensional Langevin equation as the companion reconstruction paper, with drift and diffusion terms estimated non-parametrically from historical prices via the Kramers–Moyal coefficients, and it is a genuinely good model when the market is at equilibrium: historical prices then represent future price evolution, consistent with a time-invariant probability density. The paper is explicit about why that assumption breaks: the Langevin equation is Markovian, so its simulated trajectories depend only on the present price level and revert toward historical equilibrium values regardless of whether the market has actually moved to a new regime.
Yₜ is where the departure from a purely physical model happens. Rather than hand-designing a correction term, it is modelled with a neural ordinary differential equation, dYₜ = f(Yₜ, t, θ)dt, where f is a neural network parametrising the vector field and θ its weights. Unlike a fixed-horizon neural network, a NODE treats time as continuous, so once trained it can be evaluated at any future point, giving the residual model the same continuous-time character as the Langevin equation it complements.
Derivation
The two models are not trained together. Given an initial price S_t₀, the paper first simulates n = 1000 independent price paths {X_t₀, …, X_t₀₊ₚ} from the Langevin equation over a training window of p days, and compares them against the actual prices over that same window to build the residual dataset 𝒟ₙᵖ = {S_t₀ − X_t₀, …, S_t₀₊ₚ − X_t₀₊ₚ}ₙ. The NODE is trained on this dataset to reproduce Yₜ, using mean absolute error as the loss and mini-batch gradient descent (32 samples per batch, 2000 epochs, learning rate 10⁻³).
The network itself is small by design: one hidden layer of 96 neurons with a hyperbolic-tangent activation, 24 inputs and 24 outputs to match the dimensionality of the Langevin equation. Once trained on the in-sample window, the NODE’s continuous-time structure lets it extrapolate Yₜ over an out-of-sample horizon q, which is then added back to a fresh batch of simulated Xₜ paths to produce the final forecast.
The paper is direct about why the NODE is bolted on after the Langevin equation rather than replacing it end-to-end: a network expressive enough to learn the full price dynamics from scratch would need to be deep enough to lose interpretability, would have only one historical time series to train on and would risk overfitting to it. Training the NODE only on the residual, the part the physical model demonstrably cannot explain, sidesteps all three problems: the interpretable part of the forecast stays interpretable, and the network sees n independent residual trajectories rather than a single sample.
Results
The Langevin equation alone is validated first, and it does what a stationary model should: given a start date in a calm period, its simulated paths track the true price closely, correctly reproducing daily fluctuations, hourly mean-reversion, and the distinct equilibrium price for each hour already established in the companion paper.
Three non-stationary scenarios then probe where that stops working. Scenario (a) starts near equilibrium but the market develops a sustained upward trend; the Langevin equation’s simulated paths stay anchored to the old equilibrium and miss the trend entirely. Scenario (b) starts during a period of unusually high volatility; the Langevin equation reverts the elevated initial prices back toward equilibrium and damps out the volatility it should be reproducing. Scenario (c) starts far from equilibrium with a persistent upward trend already under way; the Langevin equation pulls prices back toward the old equilibrium in the wrong direction entirely, compounding rather than correcting the error.
Adding the NODE’s prediction of Yₜ to the Langevin paths corrects scenarios (a) and (c) substantially, since a sustained trend is exactly the kind of smooth, slowly-varying external drift the network was trained to reconstruct. Scenario (b) is different in kind rather than degree: the NODE was trained to predict a first-moment shift (a level change), and high volatility is a second-moment effect (a change in spread), which the same mechanism does not address.
Validation
The combined framework is benchmarked against two naive rules built on the same Langevin backbone: “LE + 1-day difference”, which carries forward the most recent day’s deviation from the Langevin path, and “LE + initial-condition difference”, which carries forward the deviation at the forecast’s starting point. Both are the kind of simple heuristic a market analyst might reach for without a learned residual model at all.
Measured by mean absolute error, the full LE+NODE framework wins outright in scenario (c), the case that matters most, since it combines a large initial deviation with a persistent trend, the hardest of the three. In scenario (a) it performs on par with the best naive rule. In scenario (b), the high-volatility case, the naive “1-day difference” rule achieves a lower MAE, but LE+NODE still produces a tighter interquartile range, meaning its errors are more consistent even when not the smallest on average. Across all three scenarios together, the paper’s conclusion is that LE+NODE is the most robust choice rather than the winner in every individual case, which is a more honest claim than the framework being uniformly best.
Why it matters
This is the closest of our papers to what the products actually do. The Spanish day-ahead market is the market our energy forecasting runs in, and non-stationarity is its normal condition rather than an edge case.
The structure is also worth noting on its own: rather than replacing a physical model with a neural network, the neural component is confined to what the physical model demonstrably misses. The interpretable part stays interpretable.
Citation
Antonio Malpica-Morales, Miguel A. Durán-Olivencia, Serafim Kalliadasis. Forecasting with an N-dimensional Langevin equation and a neural-ordinary differential equation. Chaos: An Interdisciplinary Journal of Nonlinear Science, 2024. https://doi.org/10.1063/5.0189402