Schwartz-Smith 2-factor model - Parameter estimation

Estimates the model parameters of the 2-factor model presented in Schwartz-Smith(2000).
1.8K Downloads
Updated 12 Dec 2015

View License

Estimates the model parameters of the 2-factor model presented in Schwartz-Smith(2000) paper(Short-Term Variations and Long-Term Dynamics in Commodity Prices) using MLE and the Kalman filter. Basted on the estimated parameters the two factors are then generated.
This code allow the user to easy select different data frequency based on supplied daily data, estimate the model on a sub-sample of the supplied total dataset, add or remove some of the future contracts from the supplied dataset in the estimation, select initial guesses for the parameters and initial sates.

This code also runs the estimation for a geometric Brownian motion model and a Ornstein-Uhlenbeck model to be used as a benchmark. The Schwartz-Smith 2-factor model is then compared to the two one factor model by Log-L scores, LR test with p-values, and statistics of the errors between the generated future curve and the observed one (mean error, mean absolute error, standard deviation of error).

The two state variables are the finally presented in a graph (see the screen shot).

This code was written to enable the study in my Masters Degree Thesis: http://www.lunduniversity.lu.se/lup/publication/3809118

Approximately the same Crude Oil
data as used in Schwartz-Smith(2000) is supplied.

Cite As

Dominice Goodwin (2024). Schwartz-Smith 2-factor model - Parameter estimation (https://www.mathworks.com/matlabcentral/fileexchange/43352-schwartz-smith-2-factor-model-parameter-estimation), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

- Updated link to the Master Thesis
- User descriptions
- The supplied data

1.0.0.0