Schwartz-Smith 2-factor model - Parameter estimation
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
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Computer Vision Toolbox > Tracking and Motion Estimation > Motion Estimation >
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.