← Back to Projects

EDM-CSDI for Financial Time Series (MSc Thesis)

Conditional diffusion models for generating S&P 500 returns and reproducing their statistical properties.

Date
July 20, 2026
Collaborators
Giacomo Negri
Links
›Contents

Overview

Financial returns are difficult to model because they are not normally distributed: extreme movements occur more frequently than Gaussian models predict, volatility changes over time, and negative returns are often followed by increased market uncertainty.

This thesis investigates whether diffusion models can learn these properties directly from historical financial data.

I developed EDM-CSDI, a conditional diffusion model that generates daily Close log-returns from same-day Open, High, and Low market information. The model combines the temporal architecture of Conditional Score-based Diffusion Models with the training and sampling framework of Elucidated Diffusion Models.

The experiments use more than 40 years of daily observations from 210 long-running S&P 500 constituents. The generated returns are evaluated against the empirical data and classical GARCH-X and Merton-X models.

The main result is that conditioning provides the volatility-regime information missing from unconditional generation. Compared with unconditional EDM-CSDI, the conditional model:

  • reduced the excess-kurtosis deficit from approximately 49% to 1%;
  • improved the Wasserstein-1 distance by almost five times;
  • achieved a CRPS skill score of 40.44% over an OLS baseline;
  • reproduced heavy tails, volatility clustering, and the leverage effect more faithfully.
Progressive noising of financial time series

Forward diffusion progressively transforms financial returns into noise.

Denoising and generation of financial time series

The learned reverse process reconstructs financial return sequences.


The problem

Financial returns exhibit several well-established stylized facts:

  • Heavy tails: extreme movements occur more frequently than under a Gaussian distribution.
  • Volatility clustering: periods of high and low volatility tend to persist.
  • Leverage effect: negative returns are often associated with higher future volatility.
  • Asymmetry: large downward and upward movements do not occur with the same frequency or magnitude.

Classical parametric models encode some of these properties explicitly, but their assumptions restrict the distributions they can represent.

Diffusion models offer a different approach: instead of specifying a fixed return distribution, they learn to generate it through a gradual denoising process.

The central research question was therefore:

Can diffusion models reproduce the distribution and stylized facts of financial returns, and does conditioning on Open, High, and Low prices improve their ability to represent different market regimes?


Data

The experiments use daily adjusted OHLC observations from 210 long-running S&P 500 constituents, each with at least 40 years of historical data.

Open, High, Low, and Close prices are transformed into log-returns relative to the previous Close:

rtC=log⁡(CtCt−1)r_t^C = \log\left(\frac{C_t}{C_{t-1}}\right) rtO=log⁡(OtCt−1),rtH=log⁡(HtCt−1),rtL=log⁡(LtCt−1).r_t^O = \log\left(\frac{O_t}{C_{t-1}}\right), \qquad r_t^H = \log\left(\frac{H_t}{C_{t-1}}\right), \qquad r_t^L = \log\left(\frac{L_t}{C_{t-1}}\right).

The historical sequences are divided into sliding windows, with a strictly held-out set used to evaluate conditional generation.


Research design

The research was conducted in two phases.

Phase 1 — Replication

The first phase implemented and evaluated several score-based diffusion processes:

  • Variance Exploding SDE;
  • Variance Preserving SDE;
  • GBM-inspired diffusion;
  • linear, cosine, and exponential noise schedules.

These experiments established a baseline and tested whether a CSDI-derived Transformer could learn univariate Close-return distributions.

The strongest configurations learned the centre of the return distribution and reproduced the principal stylized facts at a reduced scale. However, they consistently underestimated higher-order moments and extreme events.

The GBM-inspired configurations failed to reproduce the empirical tails and generated approximately Gaussian samples.

Phase 2 — EDM-CSDI

The second phase integrated the CSDI architecture into the EDM framework.

The resulting model receives:

  • clean Open, High, and Low returns;
  • a noised Close return;
  • a conditioning mask;
  • temporal and feature embeddings;
  • the current diffusion noise level.

During generation, Open, High, and Low remain observed while the model reconstructs the corresponding Close-return distribution:

p(Ct∣Ot,Ht,Lt).p(C_t \mid O_t, H_t, L_t).

This makes it possible to compare unconditional generation with generation informed by the market conditions observed during the same trading day.

EDM-CSDI architecture

High-level overview of the CSDI denoising network used within the EDM framework.


Distributional results

The decisive improvement came from conditioning the model on Open, High, and Low returns.

ModelStandard deviationSkewnessExcess kurtosisW₁ ↓Tail exponent
Reference data1.0000-0.586439.5—4.418
Phase 1 VE + Exponential0.9520-0.238214.30.00194.634
EDM-CSDI, unconditional0.7523-0.229220.00.00294.640
EDM-CSDI, conditional0.9487-0.539039.00.00064.572

The unconditional model tended to revert toward an average volatility regime. Consequently, it generated insufficient variance, skewness, and excess kurtosis.

OHL conditioning supplied information about the current market regime, allowing the conditional model to reproduce both ordinary observations and extreme movements more accurately.

Conditional EDM-CSDI distribution

Distribution of returns generated by conditional EDM-CSDI compared with the empirical reference. The model closely reconstructs both the central distribution and its tails.


Stylized facts

The conditional model produced the closest overall representation of the three stylized facts examined in the thesis.

Heavy tails

The empirical power-law tail exponent was approximately 4.42, compared with 4.57 for conditional EDM-CSDI. The model also reproduced the observed excess kurtosis almost exactly: 39.0, compared with 39.5 in the reference data.

Volatility clustering

Conditional EDM-CSDI reproduced the slowly decaying autocorrelation of absolute returns more accurately than the unconditional models.

The improvement was concentrated in high-volatility windows, supporting the interpretation that Open, High, and Low provide an informative volatility-regime signal.

Leverage effect

The model captured the negative relationship between past returns and future volatility more clearly than the classical baselines and unconditional diffusion models.

Stylized facts reproduced by conditional EDM-CSDI

Reference and generated heavy tails, volatility clustering, and leverage effects for conditional EDM-CSDI.


Probabilistic results

The conditional model was also evaluated as a probabilistic predictor by generating 50 possible Close-return sequences for each conditioning window.

ModelMAE ↓CRPS ↓
Climatology0.650650.48235
OLS with OHL predictors0.285200.21255
EDM-CSDI, conditional0.193790.12659

This corresponds to a CRPS skill score of:

  • 73.76% over climatology;
  • 40.44% over the OLS baseline.

Prediction intervals were well calibrated at moderate confidence levels:

Nominal intervalEmpirical coverage
50%53.05%
80%82.52%
90%90.50%
95%94.02%
99%96.84%

The lower-than-expected coverage of the 99% interval indicates that the model remains overconfident for the most extreme observations—an important limitation for risk-sensitive applications.


Volatility regimes

The conditional model distinguished between low- and high-volatility windows more effectively than its unconditional counterpart.

This result helps explain the broader performance improvement: Open, High, and Low movements communicate whether the market is experiencing an ordinary or unusually volatile trading period.

Conditional and unconditional volatility comparison

Reference volatility compared with the volatility generated by conditional and unconditional EDM-CSDI. The conditional model responds more accurately to changing market regimes.


Limitations

The results are promising, but they do not imply that the model is ready for direct financial deployment.

The main limitations are:

  • the experiments cover only long-running S&P 500 constituents;
  • extreme prediction intervals remain overconfident;
  • the central zero-return spike is not reconstructed perfectly;
  • valid OHLC relationships such as H≥C≥LH \geq C \geq L are not explicitly enforced;
  • evaluation focuses on statistical fidelity rather than trading or risk-management performance;
  • rare events remain difficult to learn from historically imbalanced data.

Future extensions could evaluate the model across other asset classes and market regimes, enforce valid OHLC constraints, improve tail calibration, and assess its usefulness for Value at Risk, Expected Shortfall, option pricing, and stress testing.


Conclusion

Diffusion models can learn meaningful features of financial return distributions, but architecture and preconditioning alone are insufficient.

The critical improvement came from supplying the model with information about the current market environment. By conditioning Close-return generation on Open, High, and Low movements, EDM-CSDI moved beyond an average volatility representation and reproduced heavy tails, asymmetry, volatility clustering, and the leverage effect substantially more accurately.

More broadly, the project shows that conditioning is not merely an architectural addition: it provides the regime information necessary for generative models to represent the changing statistical behaviour of financial markets.