Code covered by the BSD License  

Highlights from
Schwartz-Smith 2-factor model - Parameter estimation

5.0

5.0 | 1 rating Rate this file 30 Downloads (last 30 days) File Size: 35.5 KB File ID: #43352
image thumbnail

Schwartz-Smith 2-factor model - Parameter estimation

by

 

04 Sep 2013 (Updated )

Estimates the model parameters of the 2-factor model presented in Schwartz-Smith(2000).

| Watch this File

File Information
Description

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/o.o.i.s?id=24965&postid=3809118

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

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
27 Oct 2013 gammone

Hi Dominice,
thanks for this script, it's very useful. I should replicate the figure 2 of the paper in question. I saw that the script already producing the figure 4. Can you kindly help me? Thanks a lot

25 Oct 2013 Dominice Goodwin

Sofy,

You find the Short-Term deviations in the first column of variable ss_att and the equilibrium price in the second column of variable ss_att.

the estimated model parameters are printed to the command window or can be found in variables:
ss_psi_estimate
ss_SE

24 Oct 2013 Sigma

Hi,
in the description of the file is written: "Estimates the model parameters of the 2-factor model presented in Schwartz-Smith paper(Short-Term Variations and Long-Term Dynamics in Commodity Prices)..."
I tried to apply your code at the data you put in, but I don't understand the outputs; which of the outputs are the Short-Term Variations and Long-Term Dynamics?
Thank you a lot.

Updates
07 Oct 2013

- User descriptions
- The supplied data

Contact us