Certificate in Quantitative Finance Module 6 Assessed Assignment 2012 Luigi Piva Multi-Variate Time Series Analysis A multivariate time series consists of several series. Therefore, the concepts of vector and matrix are important in multivariate time series analysis Many of the models and methods used in the univariate analysis can be generalized directly to the multivariate case, but there are situations in which the generalization requires some attention. In some situations,we need new models and methods to manage the complex relationships between different series. I decided to use five important energy futures, importing closing data into a spreadsheets. The time series, cover the period from 31/05/2007 to 16/07/2012: Crude Oil Ethanol Gasoline Heating Oil Natural Gas In the graph below we see the series . Obviously the value of each series is different from the others, to be able to easily view all the series together, all the time series start from the same point, one, and move proportionally
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Certificate in
Quantitative Finance
Module 6 Assessed Assignment
2012
Luigi Piva
Multi-Variate Time Series Analysis
A multivariate time series consists of several series. Therefore, the concepts of vector and matrix are
important in multivariate time series analysis
Many of the models and methods used in the univariate analysis can be generalized directly to the
multivariate case, but there are situations in which the generalization requires some attention. In some
situations,we need new models and methods to manage the complex relationships between different
series.
I decided to use five important energy futures, importing closing data into a spreadsheets.
The time series, cover the period from 31/05/2007 to 16/07/2012:
Crude Oil
Ethanol
Gasoline
Heating Oil
Natural Gas
In the graph below we see the series . Obviously the value of each series is different from the others, to
be able to easily view all the series together, all the time series start from the same point, one, and
move proportionally
To plot this chart , all series start at one. In the subsequent period, the value is equal to one plus the
variation, calculated as follows:
Value = (today'close-yesterday close) / yesterday close
The series then continues by adding the following variation to the accumulated value up to that
moment.
In an initial visual inspection, the series appear to be trending. In the markets of Gasoline and Ethanol
there is a positive trend, while for what concerns Crude Oil and Heating Oil,the evolution is more an
oscillatory movement . There is a negative trend for the Natural Gas. Does not appear that futures have
a mean-reverting behavior, meaning that they tend to move around a mean value. Again visually, it
seems that Crude Oil and Heating Oil are related, as well as Ethanol and Gasoline.
-1
-0,5
0
0,5
1
1,5
2
2,5
3
1
45
89
13
3
17
7
22
1
26
5
30
9
35
3
39
7
44
1
48
5
52
9
57
3
61
7
66
1
70
5
74
9
79
3
83
7
88
1
92
5
96
9
10
13
10
57
11
01
11
45
11
89
12
33
12
77
CL
HO
NG
GS
ET
If we plot daily returns, we get the following chart : from the top to the bottom, Crude Oil, Ethanol,
Gasoline, Heating Oil and Natural Gas:
The behaviour is completely different. The values are moving around zero. some series (Crude
Oil, Ethanol, Heating Oil) show larger daily variations if compared to other series (Gasoline,
Natural Gas).
Flow Diagram
In the flow chart below we see the major steps we will follow in this project.
Augmented Dickey-Fuller Test
We may be interested, in the individual time series first . Univariate time series are integrated if
can be brought to stationarity through differencing.
Using the Augmented Dickey Fuller test we can test the individual time series and see if they
are stationary
The following table summarizes the results:
H0 PValue Stat
Crude Oil 0 0.4513 -0.5477
Ethanol 0 0.8781 0.7621
Gasoline 0 0.7175 0.1787
Heating Oil 0 0.5804 -0.1955
Natural Gas 0 0.4215 -0.5561
For all time series ,the null hypothesis of unit root is not rejected, the price series are not
stationary, they are probably integrated. To make the series stationary we could take the
differences. The number of differences that we have to take to make the series stationary is the
order of integration
For all five series the order of integration is equal to one, can be compared to variables AR1
We repeat the ADF test for the daily returns series:
H0 PValue Stat
Crude Oil 1 <Min -37.55
Ethanol 1 <Min -36.28
Gasoline 1 <Min -36.76
Heating Oil 1 <Min -36.45
Natural Gas 1 <Min -40.53
The result is obviously completely different, in all the cases the null hypothesis is rejected and
the series are stationary and non-integrated.
The AR models are normally used to study stationary time series, when we speak of multi-
variate time series models we refer to VAR (Vector Auto-Regression) models.
We will now use VAR models to analyze the returns of the five energy futures.
Vector Autoregressive Models
VAR is a simple and useful model for modeling our vectors of returns . We will think in terms
of a model like the following:
Yt is a vector [n:1] e A is a [n:n] matrix of the coefficients of the lagged variable Yp . In this
case the lag of the model is equal to 1.
Determining an appropriate number of lags
Among the various methods to derive the most appropriate number of lags, we will use Akaike
Information Criterion, which requires various values : the likelihood and the number of active
parameters in the model.
In practice, we can quickly obtain these data modeling our VAR for different lag (1,2,3,4 ...),
keeping in mind that the first values are the most likely. To obtain the likelihood in Matlab,
simply type LLF after the estimate of the model parameters. To derive the number of active
parameters:
[NumParam,NumActive]=vgxcount( Model name )
To calculate Akaike Information Criterion
AIC = aicbic([LLF1, ...LLFn],[Np1,...Npn])
where LLF indicates the likelihood and Npn indicates the nth number of active parameters.
The lowest values of the AIC indicates the best lag.
VAR(p) Likelihood NumParam AIC
1 1.5890e+004 5 -31770
2 1.5936e+004 5 -31862
3 1.6109e+004 5 -32208
4 1.6188e+004 5 -32366
Obviously, we will choose a VAR (1), model, ie with lag equal to one.
VAR(1) Parameters Estimation
In order to estimate the model using Matlab we will follow the following steps:
1. import stationary time series, collected in a matrix in excel with a series of returns in each of
the columns and a number of rows equal to the observations.
2. Create the VAR model
We want to build a VAR model with one lag , a constant and five series:
Model = vgxset('n',5,'nAR',1,'Constant',true)
3. Fit the model to the data
We also want to find the values of the constants, parameters and of the covariances of the