time series financial econometrics
TRANSCRIPT
1
Times-‐Series Financial Econometrics
Brian Bannon
2
Table of Contents
Introduction ........................................................................... 3
Data Selection ........................................................................ 3
Exploratory Data Analysis ....................................................... 3
Unit Root Testing ................................................................... 6
Testing for white noise ........................................................... 9
Testing for correlation .......................................................... 10
Potential Models .................................................................. 12
Testing for Independence ..................................................... 13
Assessing the Density plot .................................................... 14
Fitting AR, MA, and ARMA models ....................................... 15 Autoregressive Model with Order 3 ................................... 15 Moving Average Model with Lag 3 ..................................... 19 Fitting an ARCH (1) Model .................................................. 32 Fitting an GARCH (1,1) Model ............................................. 35
Conclusions .......................................................................... 39
Sources ................................................................................ 40
References ........................................................................... 40
3
Introduction In this report we have tried to bring a number of time-‐series econometric methods together to
analyze a ten year historical share price. Some of the techniques we employ include analyzing
data via exploratory data analysis to help us select suitable transformations for our data,
various tests and observations that allow us to select appropriate statistical models for our
sample and testing the fit and forecasting power of these models of these models. Our goal is
to expand on the techniques that we have developed in past weeks and combine our chosen
model with a volatility model such as ARCH(1) or GARCH(1,1). This will allow us to form solid
conclusions and find the most appropriate model which will give realistic insight about the
behavior of the variable of interest.
Data Selection For our variable of interest, our selected historical data is the ten-‐year weekly stock price for
Astra-‐Zeneca. Our data is sourced from https://uk.finance.yahoo.com/ and covers the period
from 14/03/2005 until 09/03/2015. We have used the software STATA 13 for the purpose of
analyzing this data in a variety of ways.
Exploratory Data Analysis The first step in our exploratory data analysis is to generate the summary statistics for our
variable. However without any other variables to compare to, we gain little knowledge from
these figures.
4
Table 1 summary statistics
Variable Obs Mean Std. Dev. Min Max
Close 522 50.2663 9.307929 30.65 81.02
To achieve a greater level of insight on this data we have plotted the Astra-‐Zeneca share price
against time for the last ten years (Figure 1.). Our first observation is that this time-‐series data is
non-‐stationary therefore we know that in its current form it is not suitable to work with and
that we will have to attempt to transform it before we can proceed to any greater in-‐depth
analysis.
Figure 1. Historical share price
3040
5060
7080
Close
2005w1 2010w1 2015w1Date
5
In an attempt to transform it into a stationary state that we can work with, we generate both
the percentage returns and the log returns of this data. To do this we take the one period
change of each of these variables using log transformation (1) and percentage returns (2).
log 𝑅𝑒𝑡𝑢𝑟𝑛𝑠 (i) = ln(𝑝𝑟𝑖𝑐𝑒) − ln 𝑝𝑟𝑖𝑐𝑒 𝑛 − 1 ×100 (1)
Percentage returns = (price/price[_n-‐1] -‐ 1) X 100 (2)
Figure 2. Percentage returns and log returns
Both these transformations produce a stationary series that are similar in appearance and
which are acceptable for modeling. Both transformations are display similar patterns in
volatility and both have similar standard deviations that fluctuate about the mean zero. We do
-20
-10
010
20
Close_pret
2005w1 2010w1 2015w1Date
-20
-10
010
20
Close_lret
2005w1 2010w1 2015w1Date
6
not have a preference for one model over another. This gives us incentive to pursue further
transformations.
Unit Root Testing The early and pioneering work on testing for a unit root in time series was done by Dickey and
Fuller (Dickey and Fuller 1979, Fuller 1976). The basic objective of the test is to test the null
hypothesis that φ =1 in:
Pt = φPt-‐1 + et (3)
Pt = φ0 + φ Pt-‐1 + et (4)
Against the one-‐sided alternative φ<1. So we have;
H 0: series contains a unit root
H1: series is stationary.
The series we use in the augmented Dickey-‐Fuller test is given by;
Unit root testing allows us to test weather the log price of an asset follows a random walk or a
random walk with a drift.
7
Table 2 Unit root test with 0 lags
Dickey-‐Fuller test
for unit root
Number of obs = 521
Test Statistic 1% Crit. Val 5% Crit. Val 10% Crit. Val
Z (t) -‐1.858 -‐3.430 -‐2.860 -‐2.570
MacKinnon approximate p-‐value for Z(t) = 0.3522
Given the above p-‐value (Table . 2) we do not reject the null hypothesis, hence the series
requires further transformation as in this state we cannot fit our usual models. Using zero lags
we are essentially using the simple Dickie-‐Fuller model.
Table 3 Unit root test with 1 lags
Dickey-‐Fuller test
for unit root
Number of obs = 520
Test Statistic 1% Crit. Val 5% Crit. Val 10% Crit. Val
Z (t) -‐1.746 -‐3.430 -‐2.860 -‐2.570
MacKinnon approximate p-‐value for Z(t) = 0.4076
Increasing the lags to one we view very little change to our results and we still cannot reject the
null hypothesis. Taking a new approach we create the difference of the log of the share price
and input that into the Augmented Dickey-‐Fuller unit root test.
8
Table 4 Unit root test with 0 lags (With log difference)
Dickey-‐Fuller test
for unit root
Number of obs = 520
Test Statistic 1% Crit. Val 5% Crit. Val 10% Crit. Val
Z (t) -‐24.252 -‐3.430 -‐2.860 -‐2.570
MacKinnon approximate p-‐value for Z(t) = 0.0000
Finally using this method we achieve a result that allows us to reject the null hypothesis. A p-‐
value of 0.0000 tells us that the under-‐lying series is not a unit root and that we have the
possibility of applying the AR(P), MA(P) and ARMA(P) models. Plotting the log difference will
help us compare this transformation with the previous efforts.
Figure 3.
-20-10
010
20
Close_pret
2005w1 2010w1 2015w1Date
-20-10
01020
Close_lret
2005w1 2010w1 2015w1Date
-10 -5051015
Closed
2005w1 2010w1 2015w1Date
9
Comparing the log difference to the log returns and percentage returns and we decide to use
the log difference as our series going forward. Again the log difference shows similar patterns
to the previous transformations. However the log difference demonstrates much lower
volatility than both the previous transformations. This can be shown by isolating the major
deviations from the mean such as 2008/9 and late 2014. It is clear from these examples that the
log difference is comparatively less volatile than both the log returns and the percentage
returns.
Testing for white noise A time series is said to be White Noise when there is no correlation between the variables,
meaning all autocorrelations are equal to zero. If a series is not white noise it indicates that
there is dependency between the past lags of the series. However, a white noise series suggests
that the movement of the series is random and the future does not depend on past. To test this
formally, we have constructed Portmanteau test of White.
Ho: ρ1=ρ2=...=ρm=0
HA: at least one autocorrelation is different from 0
We can use the first lags=ln (T) 2, which in our case is lags=ln (522) 2 = 39.325 or 39(rounded)
lags.
10
Table 5.
Portmanteau test for white noise
Portmanteau (Q) statistic = 64.9624
Prob > chi2(39) = 0.0056
From the table above, we find that the p-‐value is 0.0056, so we reject the null hypothesis of
zero autocorrelations at all 10%, 5% and 1% levels of significance. This indicates that there is
correlation between the past lags of Astra-‐Zeneca’s returns. Therefore we can say that the price
changes for Astra-‐Zeneca’s stock price is not random and excess returns can be made by trend
analysis. Therefore, the price of Astra-‐Zeneca is reflective of historical information.
Testing for correlation When we fit a model, we aim to check if the residuals are uncorrelated. If they are, then the
model does a good job. However, if the residuals are serially correlated then there is a level of
persistence in the original series which is not captured by the model. By plotting the Auto-‐
correlation and partial auto correlations we hope to identify any existing correlation. The
autocorrelation function verifies if there is any linear dependency of the variables with
themselves. The partial autocorrelation function is a conditional correlation and it is used to
identify the order of the autoregressive model. In the following graphs, we have plotted the
first fifty ACFs and PACFs for each variable.
11
Figure 4. ACF & PACF for log difference of Astra-‐Zeneca share price
On first inspection our series appears to be significantly uncorrelated. From the correlogram
above we can see that in both the auto-‐correlation and the partial auto-‐correlation on the third
lag produces a result that demonstrates an explanatory effect well outside the 95% confidence
boundary. The partial however also produces a significant result on the 18th lag and results on
the 95% confidence boundary for lags 28 and 31. The 18th lag result for the auto-‐correlation is
close to the 95% boundary.
-0.2
0-0
.10
0.00
0.10
Aut
ocor
rela
tions
of C
lose
d
0 10 20 30 40 50Lag
Bartlett's formula for MA(q) 95% confidence bands
-0.2
0-0
.10
0.00
0.10
Par
tial a
utoc
orre
latio
ns o
f Clo
sed
0 10 20 30 40 50Lag
95% Confidence bands [se = 1/sqrt(n)]
12
Potential Models The commonly used models for forecasting are Autoregressive (AR), Moving Average (MA) and
Autoregressive Moving Average Models (ARMA). To identify which specific models we should
use we need to look again at the ACF and PACF values.
Table 6. ACF & PACF for log difference of Astra-‐Zeneca share price
LAG AC PAC Q Prob>Q [Autocorrelation]
[Partial
Autocor]
1 -‐0.0634 -‐0.0634 2.103 0.147 | | 2 0.0385 0.0349 2.8799 0.2369 | | 3 -‐0.2055 -‐0.203 25.087 0 -‐| -‐| 4 0.0112 -‐0.0142 25.153 0 | | 5 -‐0.0009 0.0116 25.154 0.0001 | | 6 0.0144 -‐0.0269 25.263 0.0003 | | 7 -‐0.0035 -‐0.0068 25.269 0.0007 | | 8 -‐0.0476 -‐0.0475 26.473 0.0009 | | 9 0.0394 0.034 27.301 0.0012 | | 10 -‐0.0137 -‐0.0095 27.401 0.0022 | | *ACF for higher lags provides the same qualitative conclusion
The correlogram (Table.6) suggests that we should fit an MA (3) model (based on the ACF) and
an AR (3) model (based on the PACF). Despite significant results being expected at later lags, we
find on these more accurate that this is not the case. To further elaborate on this we need to
calculate and graph the AIC values, however we will leave this stage until a later time.
Unfortunately, we cannot use the ACF/PACF methods for selecting the order of the ARMA
model. However we may find in later testing that the ARMA model is a good fit for this series.
13
Testing for Independence If a series is independent then, the absolute series or the squared series will be uncorrelated as
well. So, if we want to have a graphical illustration of dependency, we can generate the squared
(or absolute) series, calculate their ACF and compare.
Figure 5. Residuals and Squared residuals
These plots suggest that the weekly returns are serially not independent. It seems that the
returns are indeed serially uncorrelated, but dependent. They fluctuate above and below the
mean with little correlation. The only slight pattern exists as the residuals do register readings
outside the 95% confidence boundaries in two of the first three readings before they somewhat
converge on the mean suggesting that it is not independence that exists in the series. This
presents a good opportunity to do the Ljung-‐Box test on the squared residuals series to test if
there are ARCH effects present.
-0.2
0-0
.10
0.00
0.10
Aut
ocor
rela
tions
of a
_Clo
sed
0 10 20 30 40 50Lag
Bartlett's formula for MA(q) 95% confidence bands
Astra-Zeneca Residuals
-0.1
00.
000.
100.
200.
30
Aut
ocor
rela
tions
of a
_Clo
sed2
0 10 20 30 40 50Lag
Bartlett's formula for MA(q) 95% confidence bands
Astra-Zeneca SQ. Residuals
14
Table 7.
Portmanteau test for white noise
Portmanteau (Q) statistic = 63.5077
Prob > chi2(5) = 0.0000
This test allows us to identify that there are ARCH effects present in our model. We will come
back to this finding later on when we will deal with this and adjust our model accordingly.
Assessing the Density plot Figure 6.
0.1
.2.3
Den
sity
-10 -5 0 5 10 15Closed
Astra-Zeneca Returns
15
Our density plot provides evidence of quite a normal distribution. Almost now skewness is
visible on the plot, and slightly higher kurtosis than the normally distributed model. Our density
plot demonstrates not particularly fat tails but there are some problematic readings; the left tail
does extend further than would be anticipated under normal distribution. Also on the right
hand side we can identify as a value of 12.36. From looking at our data we identify this anomaly
as a price jump of 18% in April 2014 during speculation of a buyout by Pfizer. On the hole the
tails provide a reading as close to the normal distribution as one could expect.
Fitting AR, MA, and ARMA models In order to find the most appropriate model we have analyzed the significance of the constant
and coefficients of the higher order terms for each of the models. Additionally, we have also
looked at the behavior of the residuals and the forecast errors. A model is good if the residuals
follow White Noise, has lowest value in terms of Akike’s Information Criteria (AIC) and lowest in
terms of forecasting error. These are discussed in detail below. From the correlogram(Table.6)
it suggests that we should fit an AR(3) model based on the PACF and a MA(3) model based on
the ACF.
Autoregressive Model with Order 3
As mentioned above the best model to fit for this series is an AR (3) model. However, the
estimate of the coefficient of the lag 1 term is significantly different from zero. This means that
we can suppress the model further by excluding the constant term.
16
Table 8.
AR(3) output
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Wald chi2(1) = 54.38
Log likelihood = -‐1013.945 Prob > chi2 = 0.0000
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
Closed _cons 0.0511514 0.0610654 0.84 0.402 -‐.0685347 0.1708375
ARMA
ar
L1 -‐0.0538921 0.0297749 -‐1.81 0.070 -‐.1122499 0.0044657
L2 0.0228 0.0356767 0.64 0.523 -‐.0471251 0.0927251 L3
-‐0.202343 0.0298566 -‐6.78 0.000 -‐.2608608 -‐0.1438252 /sigma 1.694057 0.029064 58.29 0.000 1.637093 1.751022
On estimating this model without the constant term we get the following output
17
Table 9.
AR(3) output
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Wald chi2(1) = 53.52 Log likelihood = -‐1014.303 Prob > chi2 =
0 Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
ARMA
ar
L1 -‐0.0527719 0.0295026 -‐1.79 0.074 -‐.110596 0.0050521
L2 0.0240851 0.0356122 0.68 0.499 -‐.0457135 0.0938836 L3
-‐0.2012067 0.0299621 -‐6.72 0.000 -‐.2599313 -‐0.1424822 /sigma
1.695221 0.0290356 58.38 0.000 1.638313 1.75213
So the model that we have now is
P𝑡 = 𝜑1P𝑡−1 + 𝑎𝑡 (2) (5)
Here the coefficient estimate of p𝑡−1 is -‐5.27% and is negatively related to P𝑡 indicating a
negative relation between past and future growth of Astra-‐Zeneca.
We have also extracted the residuals from the above model. Figure 7 represents the plot of
the residuals, their ACF and PACF.
18
Figure 7.
Table 10: Correlogram of ACF and PACF for the Series of AR (3) Residuals
LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor]
1 -‐0.0042 -‐0.0042 0.00922 0.9235 | |
2 0.0015 0.0015 0.01044 0.9948 | |
3 -‐0.0084 -‐0.0084 0.04758 0.9973 | |
4 -‐0.0125 -‐0.0126 0.12974 0.998 | |
5 0.0006 0.0006 0.12996 0.9997 | |
6 -‐0.0178 -‐0.0181 0.29818 0.9995 | |
7 -‐0.0078 -‐0.0082 0.3304 0.9999 | |
8 -‐0.0438 -‐0.0447 1.3514 0.9949 | |
9 0.036 0.0365 2.0416 0.9908 | |
10 -‐0.002 -‐0.0029 2.0438 0.996 | |
-10-
50
510
15AR
(3) R
esdiu
als
2005w1 2010w1 2015w1Time Period
-0.10-0
.050.000
.050.10
Autoc
orre
lation
s of a
r1re
s
0 10 20 30 40 50Lag
Bartlett's formula for MA(q) 95% confidence bands
-0.10-0
.050.000
.050.10
Partia
l auto
corre
lation
s of a
r1re
s
0 10 20 30 40 50Lag
95% Confidence bands [se = 1/sqrt(n)]
19
*ACF for higher lags provides the same qualitative conclusion
Evidently from Figure 7, the series of the residuals of the AR (3) model is stationary and has
correlation between the past lags. However, the correlogram above clearly suggests that the
residuals are uncorrelated. For further clarity, we have conducted formal test known as
Portmanteau White Noise test over past 50 lags with the following hypotheses. The null
hypothesis 𝐻𝑜 implies that the residuals follow White Noise whereas 𝐻𝑎 is the alternate
hypothesis.
𝐻0=𝜌1=𝜌2=⋯ =𝜌𝑚= 0 Otherwise,
𝐻a≠0 Table 11: Portmanteau test for white noise
Portmanteau (Q) statistic = 31.6403
Prob > chi2(39) = 0.7926
The corresponding AIC value for this model is 2036.606 and we will use this value to compare the
models in the later part of the report.
Moving Average Model with Lag 3
We start by estimating an MA (1) model for the series of ‘Closed’.
20
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Wald chi2(1) = 47.75
Log likelihood = -‐1013.949 Prob > chi2 = 0.0000
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
Closed _cons 0.0512192 0.0574343 0.89 0.373 -‐.0613498 0.1637883 ARMA
ma
L1 -‐0.0562672 0.0307972 -‐1.83 0.068 -‐.1166287 0.0040943 L2
0.0237827 0.0360276 0.66 0.509 -‐.04683 0.0943954 L3 -‐0.2033278 0.0317403 -‐6.41 0.000 -‐.2655377 -‐0.1411178 /sigma
1.694002 0.0292425 57.93 0.000 1.636688 1.751317
The regression output highlights that the constant term of this model is statistically insignificant
and hence tends to zero. Thus, it is not required to keep the constant term in the regression.
However, as the estimate of the coefficient of the first lag term is significant, we will now the
regress the model as follows.
P𝑡 =𝑎𝑡 − 𝜃1𝑎𝑡−1 (6)
21
Table 13: Regression Output without constant term Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Wald chi2(1) = 46.34
Log likelihood = -‐1014.352 Prob > chi2 = 0.0000
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
ARMA
ma
L1 -‐0.0544332 0.0304528 -‐1.79 0.074 -‐.1141195 0.0052531 L2
0.0256605 0.0360028 0.71 0.476 -‐.0449037 0.0962247 L3 -‐0.2014943 0.0318589 -‐6.32 0.000 -‐.2639366 -‐0.1390519
/sigma 1.69532 0.0292759 57.91 0.000 1.63794 1.752699
Consequently, the coefficient estimate of 𝜃1 is significantly different from zero as the p-‐value of this
term is less than the 10% level of significance and equals -‐5.44%.
We will now verify how the residuals of this model behave. According to the first graph of Figure 8,
the extracted series of residual terms is stationary and fluctuates vigorously around zero. To ensure
if there is any association between the series of the remaining terms of MA (3) model, it is vital to
concentrate on the ACF and PACF plot of the residuals.
22
Figure 8:
A dependency of the residual terms implies that there are extractions within the series of
‘Closed’ which are not being captured by this model. In such a case, AR (3) will prove to be a
better model. Graphically, the ACF and PACF of the residual series is a hint of existence of
dependency between the terms and we can see that for some lags like 16 and 35, the ACF and
PACF are not within the bounds of 95% confidence intervals (Figure 8). Hence, correlation
exists. On the contrary, according to the correlogram below, there is no association between
the past lags of the series of residual terms and they should follow White Noise process.
Perhaps there is weak dependency and this should be tested formally.
Table 14: Correlogram of ACF and PACF for the Series of MA (3) Residuals
-10-5
051
015
resid
ual, o
ne-s
tep
2005w1 2010w1 2015w1Date
MA(3) Residuals
-0.1
0-0.0
50.000
.050.
10Au
toco
rrelat
ions o
f ma1
res
0 10 20 30 40Lag
Bartlett's formula for MA(q) 95% confidence bands
-0.1
0-0.0
50.000
.050.
10Pa
rtial
auto
corre
lation
s of m
a1re
s
0 10 20 30 40Lag
95% Confidence bands [se = 1/sqrt(n)]
23
LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor]
1 -‐0.0031 -‐0.0031 0.0049 0.9442
| |
2 0.0008 0.0008 0.0052 0.9974
| |
3 -‐0.0093 -‐0.0093 0.05036 0.997
| |
4 0.008 0.0079 0.08371 0.9991
| |
5 -‐0.0077 -‐0.0077 0.11508 0.9998
| |
6 0.0213 0.0215 0.3545 0.9992
| |
7 -‐0.0063 -‐0.0062 0.37556 0.9998
| |
8 -‐0.045 -‐0.0457 1.4529 0.9935
| |
9 0.0379 0.0389 2.217 0.9876
| |
10 -‐0.0035 -‐0.004 2.2236 0.9943
| | *ACF for higher lags provides the same qualitative conclusion
By means of the Portmanteau test for White Noise with the same hypotheses we do not reject
null hypothesis that is there is no correlation between past lags of the series of the residuals.
Thus again, MA (3) does seem to be appropriate for modeling the series of ‘Closed’ This value of
0.7279 proves that the moving average model is influenced by white noise to a greater extent
than the auto regressive model.
Table 15: Portmanteau test for white noise
Portmanteau (Q) statistic = 34.2049
Prob > chi2(39) = 0.7279
24
The AIC value for this model is 2036.705. Comparing this to the figure for the AR model
(2036.606), we learn that the AR model may be a more appropriate selection as it has a lower
AIC value.
AR, MA FORECASTING
In this section we will discuss about the forecasting abilities of the models mentioned earlier.
We may have a model, which provides good fit of series of ‘Closed’, but does not forecasts well
or the other way round. This can be determined by examining the movement of the series of
forecasts and the actual series together. For a model to be able to provide accurate forecasts,
both the series of ‘Closed’ that is the actual growth of the share price and the estimated growth
that is the one period ahead forecast should move together. In the graphs to follow, we have
analyzed the movements of one period ahead prediction along with the original series for the
entire sample size, the actual values to one period ahead forecast after 2007 crisis and the
predictions for the future three weeks.
25
Figure9:
It is clear from the first graph of figure 9 that AR (1) model is good, as there is not that many
outliers during the periods 2005 and 2015. Also, the model is very effective in forecasting after
2007 up until 2010. Finally, the three weeks future forecast looks like a cyclic line; the
movement of growth series seems to be taking an up and down trend. Thus, AR (3) is very
efficient for forecasting.
-10-505
1015
2005w1 2010w1 2015w1Date
Closed y prediction, one-step
Series of Price Growth and Forecast under AR(3)
-10-5
05101
5
2007w1 2009w1 2011w1 2013w1 2015w1Date
Closed y prediction, one-step
-10-5
05101
5
2013w13 2013w40 2014w13 2014w40 2015w13Date
Closed y prediction, one-step
26
Figure 10:
Finally, the three weeks future forecast looks like a straight line; however, the movement of
growth series seems to be taking a upward trend. Thus, MA (3) is not very efficient for
forecasting.
From the above graphs, it is difficult to decipher the model in which the variation between
actual values of growth of index and their estimate is the closest. Therefore, as part of further
investigation, we have generated forecast errors and their corresponding root mean squared
errors. The purpose here is to obtain the model in which the difference between the forecasts
and actual values is lowest. The lower the difference, the closer is the estimated value to the
-10-505
1015
2005w1 2010w1 2015w1Date
Closed y prediction, one-step
Series of Price Growth and Forecast under MA(3)
-10-5
05101
5
2007w1 2009w1 2011w1 2013w1 2015w1Date
Closed y prediction, one-step
-10-5
05101
5
2013w13 2013w40 2014w13 2014w40 2015w13Date
Closed y prediction, one-step
27
actual value. In the following table, we have looked at the forecast errors, their squares and
root mean squares for this objective.
Table 16: Forecast Errors
Variable Obs Mean Std. Dev. Min Max
AR(3) Forecast Erros 521 0.0001151 1.695708 -‐8.080543 12.18697 MA(3) Forecast Errors 521 0.0002903 1.695728 -‐8.071345 12.12439
Table 17: Forecast Errors Squares
Variable Obs Mean Std. Dev. Min Max
AR(3) Forecast Errors Squared 257 0.9862074 0.4941834 0.0702771 3.490985 MA(3) Forecast Errors Squared 256 0.9872578 0.493353 0.0575543 3.482009
Table 18: Root Mean Squared Forecast Errors Model Root Mean Squared Forecast Error AR(3) 0.993079755 MA(3) 0.9936084742
Therefore, based on the above table, AR (3) is good for forecasting as it has the lowest value of
forecast error. This follows on as above as the AR (3) model had the lowest AIC and was best
fitted. It is possible to accomplish better models through further research; however, we are
going to focus only on the models that we have talked about so far.
28
IMPULSE RESPONSE ANALYSIS
Till now we have analyzed AR and MA models both in terms of their goodness of fit and
forecast errors. Another important topic in time series analysis is the Impulse Response
Analysis. In signal processing, the impulse response function of a dynamic system is its output
when infused with an input signal, called an impulse. Moreover, an impulse response refers to
the reaction of any dynamic system in response to some external change. The objective for
analyzing the Impulse Response Function (IRF) is to have an idea of the number of periods a
system requires to return to its equilibrium state following an external shock. The IRF allow us
to observe exogenous factors that may have an effect over the variable under observation,
which are the returns on Share Price of Astra-‐Zeneca (Closed) in this case. The downside of this
approach is of model misspecification as the impulse responses are derived from the models,
which we choose. Although, it is possible to minimize the problem of misspecification by using
models with the significant lag factors, this problem cannot be eliminated completely.
From our analysis above the model we have chosen with the best model fit and best forecasting
errors was the AR (3) model. Now we are going to conduct Impulse Response Forecasting on
our AR (3) model.
Using the regression output in for AR(3) above, we can calculate the IRF. The model that we are
using here is simply AR(3) with coefficient estimate of lag 3 AR parameters. We have calculated
the IRF’s for AR (1) model over a horizon of 50 periods. Each period represents a week in this
case as our data is weekly. We have represented the IRF’s graphically.
29
Figure 11: Impulse Response Function for AR (3) Model
Conducting an IRF analysis we find that after an initial shock an AR(3) model will return to its
equilibrium within the first 5 steps. We find that this readjustment is steady and stable, as it
fluctuate about the mean but stabilizes once it reaches it. Even though, this model does
generate a negative AR parameter we see that the response to the shock is fast and the model
returns to equilibrium quickly. As the constant term of AR (3) model is statistically insignificant.
We now repeat the AR (3) estimation for IRF but suppressing the constant term to get the
graph below.
-.5
0
.5
1
0 50
asymp, Closed, ClosedImpulse Response Function
95% CI impulse-response function (irf)
step
Graphs by irfname, impulse variable, and response variable
30
Figure 12: Impulse Response Function for AR (3) Model without constant
Conducting the same analysis for an AR (3) model but with the constant suppressed we
find almost no change in our result. For this model we identify the half-‐life to be 2 steps
(weeks).The model is quite adequate for dealing with shocks to the system as the model is
able to handle the perturbation. Therefore as long as the constant does not affect the
estimation of the model parameters, the IRF’s do not change dramatically. This model
therefore absorbs the shock very efficiently and returns to equilibrium quickly.
-.5
0
.5
1
0 50
asymp, Closed, ClosedImpulse Response Function without Constant
95% CI impulse-response function (irf)
step
Graphs by irfname, impulse variable, and response variable
31
VOLITILITY MODELING
In econometrics, autoregressive conditional heteroskedasticity (ARCH) models are used to
characterize and model observed time series. They are used whenever there is reason to
believe that, at any point in a series, the error terms will have a characteristic size or
variance. In particular ARCH models assume the variance of the current error term or
innovation to be a function of the actual sizes of the previous time periods' error terms:
often the variance is related to the squares of the previous innovations.
ARCH models are employed commonly in modeling financial time series that exhibit time-‐
varying volatility clustering, i.e. periods of swings followed by periods of relative calm.
ARCH-‐type models are sometimes considered to be part of the family of stochastic volatility
models but strictly this is incorrect since at time t the volatility is completely pre-‐
determined (deterministic) given previous values.
The basic idea of ARCH models is that; the shock at of an asset return is serially
uncorrelated, but the dependence of at can be described by a simple quadratic function of
its lagged values.
An ARCH (m) model assumes that
𝑎! = 𝜎! ∈! (7)
𝜎!! = 𝛼! + 𝛼!𝑎!!!! +⋯+ 𝛼!𝑎!!!!
32
where ∈! is a sequence of independent and identically distributed (iid) random variables with
mean zero and variance 1, α0>0, and αi≥0 for i>0. In practice, ∈! is often assumed to follow the
standard normal or a standardized Student-‐t distribution or a generalized error distribution.
From the structure of the model, it is seen that large past squared shocks imply a large
conditional variance σt2 for the innovation at. Under the ARCH framework, large shocks tend to
be followed by another large shock. Note that large variance does not necessarily produce a
large realization. The probability of obtaining a large variate is greater than that of a smaller
variance.
Fitting an ARCH (1) Model
Lets take a look at the ARCH(1) model, the ARCH(1) model assumes that:
𝑎! = 𝜎! ∈! (8)
𝜎!! = 𝛼! + 𝛼!𝑎!!!!
where α0>0 and α1≥0.
The unconditional mean of at remains zero
𝐸 𝑎! = 0 (9)
The unconditional variance of at can be obtained as
𝑉𝑎𝑟 𝑎! = 𝛼! + 𝛼!𝐸(𝑎!!!! ) (10)
The variance of αt must be positive, we require 0 ≤ α1 <1. In some applications, we need higher
order moments of at to exist and, hence, α1 must also satisfy some additional constraints. to
study its tail behavior, we require that the fourth moment of at is finite.
The unconditional kurtosis of at is
33
!(!!!)[!"# !! ]
= 3 !!!!!
!!!!!! (11)
Where the fourth moment of at is positive, we see that α1 must also satisfy the condition
1−3α12 > 0; that is, 0 ≤ α1
2< 1/3.
Thus, the excess kurtosis of at is positive and the tail distribution of at is heavier than that of a
normal distribution. Heavy tails are a common aspect of financial data, and hence the ARCH
models are so popular in this field. The ARCH model does not provide any new insight for
understanding the source of variations of a financial time series. It merely provides a
mechanical way to describe the behavior of the conditional variance. It gives no indication
about what causes such behavior to occur. ARCH models are likely to over predict the volatility
because they respond slowly to large isolated shocks to the return series.
34
Table 19: ARCH (1) Estimation Output
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Distribution : Gaussian Wald chi2(1) = .
Log likelihood = -‐994.2243 Prob > chi2 = .
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
Closed
_cons 0.0898433 0.0677598 1.33 0.185 -‐.0429634 0.22265
ARCH
ARCH L1. 0.3742778 0.0488602 7.66 0.000 .2785136 0.470042 _cons
1.969609 0.1010184 19.5 0.000 1.771617 2.167601
This means that the series “Closed” is not statistically significant at 10% level but the ARCH (1)
model coefficients are statistically significant at 1% level. Next we must estimate the
conditional variance of the ARCH model.
35
Figure 13:
Fitting an GARCH (1,1) Model
Although the ARCH model is simple, it often requires many parameters to adequately describe
the volatility. Bollerslev (1986) proposes a useful extension known as the generalized ARCH
(GARCH) model. Then at follows a GARCH (m, s) model if
𝑎! = 𝜎! ∈! (12)
𝜎!! = 𝛼! + 𝛼!𝑎!!!! +!
!!!
𝛽!𝜎!!!!!
!!!
020
4060
Cond
itiona
l var
iance
, one
-step
2005w1 2010w1 2015w1Date
Astra-Zeneca ARCH(1)
36
Here it is understood that αi =0 for i >m and βj=0 for j >s. The αi and βj are referred to as ARCH
and GARCH parameters, respectively. Thus, a GARCH model can be regarded as an application
of the ARMA idea to the squared series at2. The next step we do is to try and improve the
estimates of the conditional variance series adding GARCH terms in the variance equation,
which means that the variance equation depends on the past lags of the squared return series.
Similar to ARCH models the tail distributions of the GARCH (1,1) process are heavier than that
of a normal distribution. The model provides a similar parametric function that can be used to
describe the volatility evolution.
Table 20: GARCH (1,1) Estimation Output
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Distribution : Gaussian Wald chi2(1) = .
Log likelihood = -‐-‐984.1383 Prob > chi2 = .
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
Closed
_cons 0.1173372 0.067619 1.74 0.083 -‐.0151936 0.249868 ARCH
ARCH L1. 0.292738 0.0381123 7.68 0.000 .2180392 0.3674367 GARCH GARCH L1
0.5052603 0.046864 10.78 0.000 .4134085 0.5971121 _cons 0.6693727 0.111963 5.98 0.000 .4499293 0.888816
37
Figure 14:
In comparing the two volatility models we find that the GARCH(1,1) is a comparatively better
model than the ARCH(1), it reacts better to shocks in the market, this can be shown in the late
2014 where the ARCH(1) model displayed a variance of 60 while the GARCH(1,1) model
displayed a variance of 50. Other than that the performance between the two models is
extremely close and we don’t find much difference between the two.
010
2030
4050
Con
ditio
nal v
aria
nce,
one
-ste
p
2005w1 2010w1 2015w1Date
Astra-Zeneca GARCH(1,1)
38
Running now an ARCH, GARCH model with the AR(3) model.
Table 21
Sample: 2005w14 -‐ 2015w14 Number of obs = 521
Distribution : Gaussian Wald chi2(1) = 9.18
Log likelihood = -‐979.5783 Prob > chi2 = 0.027
Coef. Std. Err. z P>z [95% Conf. Interval]
Closed
Closed
_cons
0.1118747 0.0632937 1.77 0.077 -‐.0121786 0.235928
ARMA
ar
L1 0.0685083 0.0528641 1.3 0.195 -‐.0351035 0.1721201
L2 -‐0.0186734 0.0501418 -‐0.37 0.710 -‐.1169494 0.0796027
L3 -‐0.1176937 0.0478222 -‐2.46 0.014 -‐.2114234 -‐0.0239639
ARCH
ARCH L1. 0.2973271 0.0404083 7.36 0.000 .2181283 0.376526
GARCH GARCH L1 0.4601386 0.0507347 9.07 0.000 .3607004 0.5595767
_cons 0.7610978 0.1265116 6.02 0.000 .5131395 1.009056
39
Conclusions
In conclusion we find that AR(3) is the best modeling for fitting to this times series, as it has
produced the best fit with low AIC numbers and the best forecasting ability with a low Root
Mean Square of the forecasted errors. In terms of the Impulse Response Function we found the
AR(3) model dealt well with shocks to the market and returned to equilibrium within 5 time
step(weeks).
Lastly with the comparison of the ARCH and GARCH models with our desired model AR(3) we
found that the GARCH(1,1) model captured the best analysis of volatility. It performed slightly
better in comparison to the ARCH(1) model but there was only slight variation between the two
models.
40
Sources 1. https://uk.finance.yahoo.com/
References 1. Becketti, S. (2013). “Introduction to Time Series using Stata”, Stata Press
2. Box, Jenkins, and Gwilym M. Jenkins. "Reinsel. Time Series Analysis, Forecasting and
Control." (1994).
3. Tsay, R. (2010). “Analysis of Financial Time Series”, Third Edition, Wiley