Chapter 6 Time Series Analysis
Chapter 6 Time Series Analysis
CHAPTER SIX
TIME SERIES ANALYSIS
6.1. Introduction
Time Series Data is one of the important types of data used in empirical analysis. Time series
analysis comprises methods for analyzing time series data in order to extract meaningful statistics
and other characteristics of the data. It is an attempt to understand the nature of the time series and
developing appropriate models useful for future forecasting. Therefore, this chapter shall be
devoted to the discussion of introductory concepts in time series analysis mainly for two major
reasons:
1. Time series data is frequently used in practice
2. Time series data analysis poses several challenges to econometricians and
practitioners.
To emphasize the proper ordering of time series data, Table 5.1 below gives a listing of the data on
five macroeconomic variables in Ethiopia for the period 1963-2003.
In chapter-2, we studied the statistical properties of the OLS estimators based on the notion that
samples were randomly drawn from the appropriate population. Understanding why cross-
sectional data should be viewed as random outcomes is fairly straightforward: a different sample
drawn from the population will generally yield different values of the variables. Therefore, the
OLS estimates computed from different random samples will generally differ, and this is why we
consider the OLS estimators to be random variables.
How should we think about randomness in time series data? Certainly, economic time series
satisfy the intuitive requirements for being outcomes of random variables. For example, today we
do not know what the trade balance of Ethiopia will be at the end of this year. We do not know
what the annual growth in output will be in Ethiopia during the coming year. Since the outcomes
of these variables are not fore known, they should clearly be viewed as random variables.
Formally, a sequence of random variables indexed by time is called a stochastic process or a time
series process. (“Stochastic” is a synonym for random). When we collect a time series data set, we
obtain one possible outcome, or realization, of the stochastic process. We can only see a single
realization, because we cannot go back in time and start the process over again. (This is analogous
to cross-sectional analysis where we can collect only one random sample). However, if certain
conditions in history had been different, we would generally obtain a different realization for the
stochastic process, and this is why we think of time series data as the outcome of random variables.
The set of all possible realizations of a time series process plays the role of the population in cross-
sectional analysis.
inferences about a population, in time series we use the realization to draw inferences about the
underlying stochastic process.
In describing time series, we have used words such as “trend” and “seasonal” which need to be
defined more carefully. The main features of many time series are trends and seasonal variation.
A trend exists when there is a long-term increase or decrease value in the series (data). It does not
have to be linear. Sometimes we will refer to a trend as “changing direction”, when it might go
from an increasing trend to a decreasing trend. There is a trend in the time series data shown in
Figure 5.1.
If the trend in a time series is completely predictable and not variable, we call it a
deterministic trend,
Whereas if it is not predictable, we call it a stochastic trend.
A seasonal pattern occurs when a time series is affected by seasonal factors such as the
time of the year or the day of the week. Seasonality is always of a fixed and known
frequency. For example, the monthly sales of antidiabetic drugs above may shows
seasonality which is induced partly by the change in the cost of the drugs at the end of
the calendar year. Thus, seasonality is the repeating short-term cycle in the series. Or it is
the repeating patterns of behavior over time.
Seasonality is the repetition of data at a certain period of time interval. For example,
every year we notice that people tend to go on vacation during the December — January
time, this is seasonality. It is one other most important characteristics of time series
analysis. It is generally measured by autocorrelation after subtracting the trend from the
data.
From the above figure 5.2, it is clear that there is a spike at the starting of every year.
Which means every year January people tend to take ‘Diet’ as their resolution rather than
any other month. This is a perfect example of seasonality.
However, a cycle occurs when the data exhibit rises and falls that are not of a fixed
frequency.
Note that we should remove the trend and the seasonal component to get stationary
residuals.
In short, if a time series is stationary, its mean, variance, and autocovariance (at various lags)
remain the same no matter at what point we measure them; that is, they are time invariant. Such a
time series will tend to return to its mean (called mean reversion) and fluctuations around this
mean (measured by its variance) will have broadly constant amplitude. If a time series is not
stationary in the sense just defined, it is called a non-stationary time series. In other words, a
non-stationary time series will have a time varying mean or a time-varying variance or both.
Why are stationary time series so important? There are two major reasons.
1. If a time series is non-stationary, we can study its behavior only for the time period under
consideration. Each set of time series data will therefore be for a particular episode. As a
result, it is not possible to generalize it to other time periods. Therefore, for the purpose of
forecasting or policy analysis, such (non-stationary) time series may be of little practical
value.
2. If we have two or more non-stationary time series, regression analysis involving such time
series may lead to the phenomenon of spurious or non-sense regression.
How do we know that a particular time series is stationary? In particular, are the time series
shown in the above five figures stationary? If we depend on common sense, it would seem that
the time series depicted in the above five figures are non-stationary, at least in the mean values.
This is because some of them are trending upward while others are trending downwards.
Although our interest is in stationary time series, we often encounter Non-stationary time series,
the classic example being the random walk model (RWM). It is often said that asset prices, such
as stock prices follow a random walk; that is, they are non-stationary. We distinguish two types of
random walks: (1) random walk without drift (i.e., no constant or intercept term) and (2) random
walk with drift (i.e., a constant term is present).
As the preceding expression shows, the mean of is equal to its initial, or starting, value, which is
constant, but as increases, its variance increases indefinitely, thus violating a condition of
Stationarity. In short, the RWM without drift is a non-stationary stochastic process. In practice
is often set at zero, in which case ( ) = . An interesting feature of RWM is the
persistence of random shocks (random errors), which is clear from (5): is the sum of initial
plus the sum of random shocks. As a result, the impact of a particular shock does not die away. For
example, if u = 2 rather than u = 0, then all Y ’s from Y onward will be 2 units higher and the
effect of this shock never dies out. That is why random walk is said to have an infinite memory.
Interestingly, if we write (4) as
( − )= ∆ = (8)
Where, ∆ is the first difference operator.
It is easy to show that, while is non-stationary, its first difference is stationary. In other words,
the first differences of a random walk time series are stationary. But we will have more to say
about this later.
= + +
( )= + (11)
( )= (12)
As can be seen from above, for RWM with drift the mean as well as the variance increases over
time, again violating the conditions of (weak) Stationarity. In short, RWM with or without drift, is
a non-stationary stochastic process.
Remark
The random walk model is an example of what is known in the literature as a unit root
process. Since this term has gained tremendous currency in the time series literature, we
need to note what a unit root process is.
Let’s rewrite the RWM (4) as:
= + − ≤ ≤ ( )
(2) If we find that a given time series is not stationary, is there a way that it can be made
stationary? We now discuss these two questions in turn.
There are basically three ways to examine the stationarity of a time series, namely: (1) graphical
analysis, (2) correlogram, and (3) the unit root test.
Some of the above time series graph have an upward trending (MS2, EX and G) which may be an
indication of the non-Stationarity of these data sets. That means, the mean or variance or both may
be increasing with the passage of time. But, the graph for Trade Balance (TB) of Ethiopia
( ) showed a downward trend which may also be an indication of the non-Stationarity
of the trade balance (TB) series.
= : . ., =
Since both covariance and variance are measured in the same units of measurement, is a unit
less, or pure, number. It lies between −1 and +1, as any correlation coefficient does. If we plot
against k, the graph we obtain is known as the population correlogram. Since in practice we only
have a realization (i.e., sample) of a stochastic process, we can only compute the sample
autocorrelation function (SAFC), . To compute this, we must first compute the sample
covariance at lag k, , and the sample variance, , which are defined as
∑( − )( − )
= =
∑( )
= =
Therefore, the sample autocorrelation function at lag k is simply the ratio of sample covariance (at
lag k) to sample variance is given as
=
A plot of ρ against k is known as the sample correlogram.
How does a sample correlogram enable us to find out if a particular time series is stationary?
For this purpose, let us first present the sample correlogram of our Exchange rate data set given in
table-5.1. The correlogram of the Exchange rate data is presented for 20 lags in figure-5.6.
between and for any lag k are close to zero (i.e., the autocorrelation coefficient is
statistically insignificant). That is, the successive values of a time series (such as and ) are
not related to each other. Moreover, the lines on the right-hand side of the correlograms tends to be
shorter to the left or to the right from the vertical zero line for stationary time series.
On the other hand, if a series has a (stochastic) trend, i.e., nonstationary, successive observations
are highly correlated, and the autocorrelation coefficients are typically significantly different from
zero for the first several time lags and then gradually drop toward zero as the number of lags
increases. The autocorrelation coefficient for time lag 1 is often very large (close to 1).
Thus, looking at figure-5.6, we can see that the autocorrelation coefficients for the exchange rate
series at various lags are high (i.e., close to +1 from above) and low (i.e., close to -1 from below).
Figure 5.6 is an example of correlogram of a nonstationary time series.
For further illustration, the correlogram of the Trade balance and Money supply time series are
presented for 10 lags in figure-5.7 & 5.8 below.
In both correlograms, if we look at the column labeled as AC, all the values are close to 1 from
above. Moreover, the lines on the right hand side of the correlograms are also longer to the right from
the vertical zero line. That means, the lines are close to +1. Thus, both the money supply and trade
balance time series are non-stationary.
The key insight of their test is that testing for non-stationarity is equivalent to testing for the
existence of a unit root. Thus, the starting point is the unit root (stochastic) process given by:
= + − ≤ ≤ ( )
We know that if = 1, that is, in the case of a unit root, (20) becomes a random walk model
without drift, which we know is a non-stationary stochastic process. Therefore, why not simply
regress on its one period lagged value and find out if the estimated is statistically equal
to 1? If it is, then is non-stationary. This is the general idea behind the unit root test of
Stationarity.
In a nutshell, what we need to examine here is = (unity and hence ‘unit root’). Obviously, the
null hypothesis is : = , and the alternative hypothesis is : < .
We obtain a more convenient version of the test by subtracting from both sides of (20):
− = − +
∆ =( − ) +
∆ = + (21)
Where, ∆ is the first-difference operator and = − . In practice, therefore, instead of
estimating (20), we estimate (21) and test the null hypothesis : = , against the alternative
hypothesis : < . In this case, if = , then = , (i. e., we have a unit root) follows a
pure random walk (and, of course, is non-stationary).
Now let us turn to the estimation of (21). This is simple enough; all we have to do is to take the
first differences of and regress them on and see if the estimated slope coefficient in this
regression (= ) is zero or not. If it is zero, we conclude that is non-stationary. But if it is
negative, we conclude that is stationary.
The modified version of the test equation given by (21), i.e., the test equation with extra lagged
terms of the dependent variable is specified as:
∆ = +∑ ∆ + ( )
Dickey and Fuller (1981) also proposed two alternative regression equations that can be used for
testing for the presence of a unit root. The first contains a constant in the random walk process,
and the second contains a non-stochastic time trend as in the following equations, respectively:
∆ = + +∑ ∆ + ( )
∆ = + + +∑ ∆ + ( )
The difference between the three regressions concerns the presence of the deterministic elements
and .
Note that, , in all the above three test equations is the lag length for the number of lagged
dependent variables to be included. That is, we need to choose a lag length to run the ADF test so
that the residuals are not serially correlated. To determine the number of lags, , we can use one
of the following procedures.
a. General-to-specific testing: Start with Pmax and drop lags until the last lag
is statistically significant, i.e., delete insignificant lags and include the significant ones.
b. Use information criteria such as the Schwarz information criteria, Akaike’s information
criterion (AIC), Final Prediction Error (FPE), or Hannan-Quinn criterion (HQIC).
In practice, we just click the ‘automatic selection’ on the ‘lag length’ dialog box in EViews.
Now, the only question is which test we use to find out if the estimated coefficient of in (22,
23 & 24) is statistically zero or not. The ADF test for stationarity is simply the normal ‘t’ test on
the coefficient of the lagged dependent variable from one of the three models (22, 23, and
24). This test does not, however, have a conventional ‘t’ distribution and so we must use special
critical values which were originally calculated by Dickey and Fuller which is known as the
Dickey-Fuller tau statistic1. However, most modern statistical packages such as Stata and Eviews
routinely produce the critical values for Dickey-Fuller tests at 1%, 5%, and 10% significance
levels.
In all the three test equations, the ADF test concerns whether = . The ADF test statistic
is the ‘t’ statistic for the lagged dependent variable. ADF statistic is a negative number
and more negative ADF test statistic is the stronger the rejection of the hypothesis that
there is a unit root.
Null Hypotehsis (H0): If accepted, it suggests the time series has a unit root,
meaning it is non-stationary. It has some time dependent structure.
Alternate Hypothesis (H1): If accepted, the null hypothesis is rejected; it suggests
the time series does not have a unit root, meaning it is stationary.
Equivalently, if
p-value > 0.05: Accept H0, the data has a unit root and is non-stationary
p-value ≤ 0.05: Reject H0. the data does not have a unit root and is stationary
In short, if the ADF statistical value is smaller in absolute terms than the critical value(s) or
equivalently if the P-value for the ADF test statistic is significant then we reject the null hypothesis
of a unit root and conclude that is a stationary process.
Note that the choice among the three possible forms of the ADF test equations depends on the
knowledge of the econometrician about the nature of his/her data. Plotting the data2 and observing
the graph is sometimes very useful because it can clearly indicate the presence or not of
deterministic regressors. However, if the form of the data-generating process is unknown,
estimation of the most general model given by (24) and then answering a set of questions
regarding the appropriateness of each model and moving to the next model is suggested (i.e.,
general to specific procedure).
1 The Dickey-Fuller tau statistic can be found from appendix section of any statistical book (Eg: you can find it
on Gujarati).
2Sometimes if you have data that is exponentially trending then you might need to take the log of the data first
before differencing it. In this case in your ADF unit root tests you will need to take the differences of the log of
the series rather than just the differences of the series.
Illustration: Unit Root Test of Some Macroeconomic Variables of Ethiopia using EViews.
As noted above, the ADF test is based on the null hypothesis that a unit root exists in the time
series. Using the ADF test, some of the variables (TB, MS2, and EX) from our time series data set
are examined for unit root as follows.
All the above test results showed that the data sets are non-stationary. The test statistics is lower
than the critical values at 1%, 5% and 10% levels of significance for all the three data sets. This
implies the acceptance of the null hypothesis which states that there is unit root in the data sets.
A) Difference-Stationary Processes
If a time series has a unit root, the first differences of such time series (i.e., a series with stochastic
trend) are stationary. Therefore, the solution here is to take the first differences of the time series.
Returning to our Ethiopian Trade Balance (TB) time series, we have already seen that it has a unit
root. Let us now see what happens if we take the first differences of the TB series.
Figure-5.9: the first difference of the log of Ethiopian Money Supply (LMS2), 1963-2003
If you compare the above figure with figure-5.9 (i.e., the Trade Balance figure at level), you
will see the obvious difference between the two.
Table-5.6: Unit Root test of the Log of MS2 data set at first difference
Table-5.7: Unit Root test of the Log of EXR data set at first difference
In general, the above test results revealed that Trade balance (TB), log of money supply (LMS2),
and exchange rate data (EX) became stationary at first difference. In all the above test results, the
null hypothesis of Unit Root is rejected.
the long run). However, there is no long run if series are not cointegrated. This implies
that, if there are shocks to the system, the model is not likely to converge in the long run.
Note that both long run and short run models must be estimated when there is
cointegration. If there is no cointegration, there is no long run and therefore, only the
short run model will be estimated.
There are however, two prominent cointegration tests for I(1) series in the literature.
They are Engle-Granger cointegration test and Johansen cointegration test.
The Engle-Granger test is meant for single equation model while Johansen is considered
when dealing with multiple equations.
CASE 3: The series are different order of cointegration.
Researchers are more likely to be confronted with this situation. For instance, some of the
variables may be I(0) while others may be I(1).
Like case 2, cointegration test is also required under this scenario.
Recall that, Engle-Granger and Johansen cointegration tests are only valid for I(1) series.
Where the series are of different order of cointegration, the appropriate test to use is the
Bounds cointegration test.
Similar to case 2, if series are not cointegrated based on Bounds test, we are expected to
estimate only the short run. However, both the long run and short run models are valid if
there is cointegration.
Suppose that, if there really is a genuine long-run relationship between any two variables:
and , although the variables will rise/decline overtime (because they are trended), there will be a
common trend that links them together. For an equilibrium, or long-run relationship to exist, what
we require, then, is a linear combination of and that is a stationary variable [an I(0)
variable].
Assume that two variables and are individually nonstationary time series. A linear
combination of and can be directly taken from estimating the following regression:
= + +
And taking the residuals:
= − −
We now subject to unit root analysis and hence if we find that ~ (0), then the variables
and are said to be co-integrated. This is an interesting situation, for although are
individually (1), that is, they have stochastic trends, their linear combination , = − −
, is I (0). So to speak, the linear combination cancels out the stochastic trends in the two
series. If you take consumption and income as two ( ) variables, savings defined as (income −
consumption) could be (0). As a result, a regression of = + + would be
meaningful (i.e., not spurious). In this case we say that the two variables are co-integrated.
Economically speaking, two variables will be co-integrated if they have a long-term, or
equilibrium, relationship between them.
In short, provided we check that the residuals from regressions like, = + + , are
( ) or stationary, the traditional regression methodology (including the t and F tests) that we have
considered extensively is applicable to data involving (nonstationary) time series. The valuable
contribution of the concepts of unit root, co-integration, etc., is to force us to find out if the
regression residuals are stationary. As Granger notes, “A test for Cointegration can be thought of
as a pre-test to avoid ‘spurious regression’ situations”.
But, in this chapter we will use the Engle Granger (1987) two stage co-integration test procedures.
According to the Engle-Granger two steps method, first we have to estimate the static regression
equation to get the long run multiplier. In the second step an error correction model is formulated
and estimated using residuals from the first step as equilibrium error correction.
Estimate the above model using least squares and save the residuals for stationarity test.
2. Test of the Stationarity of the residuals obtained from the long run model
∆ = + +
This above regression result showed that the model is significant and we accept the alternative
hypothesis. That means, the residuals from the long run model is stationary and this implies that
regression of = + + + + + is meaningful (i.e.,
not spurious). Thus, the variables in the model have long run r/ships or equilibrium.
Assume that and are co-integrated and assuming further that is exogenous, the ECM can
be given as follows:
∆ = + ∆ + +
To account for short run dynamics, include lagged terms as:
∆ = + ∆ + ∆ + +
This is called Error Correction Model (ECM) in time series econometrics. = the lagged
values of the residuals from the long run model is used in the short run regression analysis and
this is because the last periods disequilibrium or equilibrium error affects the direction of the
dependent variable in the current period.
The coefficient of the lagged values of the residuals is expected to be less than one and negative. It
is less than 1 because the adjustment towards equilibrium may not be 100%. If the coefficient is
zero, the system is at equilibrium.
Note:
a. If is negative and significant, the adjustment is towards the equilibrium.
b. If is positive and significant, the adjustment is away from the equilibrium.
Illustration: Error Correction Model for the Trade Balance of Ethiopia
The Error Correction Model (ECM) for the Trade Balance of Ethiopia is specified as:
∆ = + ∆ + ∆ + ∆ + ∆
+ ∆ + +
Where, p and q are the optimal lag length (which can be determined by minimizing the model
selection information criteria) for the dependent and explanatory variables, respectively,
while is the one period lagged values of the residuals obtained from the
cointegrating regression, i.e., long run/static model.
Short Run Determinants of the Trade Balance of Ethiopia (Output from EViews)
Dependent Variable: DLTB
Method: Least Squares
Included observations: 39 after adjustments
Variables Coefficients Standard Error t-Statistics P-value
D(LTB(-1)) 0.238526 0.162666 1.466352 0.1523
D(LEXR(-1)) -0.079162 0.274364 -0.288531 0.7748
− = 0.516354
− = 0.425670
= 1.968382
The coefficient of the error-correction term of about − . suggests that about 89% of the
discrepancy between long-term and short-term Trade Balance is corrected within a year (yearly
data), suggesting a high rate of adjustment to equilibrium.
is meaningful (non-spurious). We do have both the long run model and short run dynamics.
We have to include the lagged value of the residuals in the short run model as one
explanatory variable.
= + + +
Where, p and q are optimal lag length for the dependent and independent variables, respectively.
is the usual white noise residuals.
∆ = + ∆ + ∆ + ∆ + ∆
+ ∆ + + + +
+ +
The coefficients − correspond to the long-run relationship. The remaining expressions with
the summation sign ( − ) represent the short-run dynamics of the model.
To investigate the presence of long-run relationships among the LTB, LMS2, LEXR, LGDP and
LG, bound testing under Pesaran, et al. (2001) procedure is used. The bound testing procedure is
based on the F-test. The F-test is actually a test of the hypothesis of no co-integration among the
variables against the existence or presence of cointegration among the variables, denoted as:
: = = = = =0
i.e., there is no cointegration among the variables.
: ≠ ≠ ≠ ≠ ≠0
i.e., there is cointegration among the variables.
The ARDL bound test is based on the Wald-test (F-statistic). The asymptotic distribution of the
Wald-test is non-standard under the null hypothesis of no cointegration among the variables. Two
critical values are given by Pesaran et al. (2001) for the cointegration test. The lower critical bound
assumes all the variables are I(0) meaning that there is no cointegration relationship between the
examined variables. The upper bound assumes that all the variables are I(1) meaning that there is
cointegration among the variables. When the computed F-statistic is greater than the upper bound
critical value, then the is rejected (the variables are cointegrated).
If the F-statistic is below the lower bound critical value, then the cannot be rejected (there is no
cointegration among the variables). When the computed F-statistics falls between the lower and
upper bound, then the results are inconclusive.
∆ = + ∆ + ∆ + ∆ + ∆
+ ∆ +
If there is cointegration, we have to estimate both the short run and long run models. And the
error correction model (ECM) representation of the trade balance ARDL model is as
follows:
∆ = + ∆ + ∆ + ∆ + ∆
+ ∆ + +
Where, ETC is the speed of adjustment parameter and is the residuals that are obtained from the
estimated cointegrated/long run model.
Step 4: Choose the appropriate lag selection criterion for optimal lag
Click on Options tab, then click on the drop-down button under Model Selection Criteria and
select the Schwarz Criterion (SC).
(Considering steps-1-4 above, we will have the below equation estimation dialog box)
Step 5: Estimate the model based on Steps 1 to 4 (i.e., click Ok in the above dialog box), to
obtain:
Step-6: Test the ARDL model for cointegration using Bounds Cointegration test. To do this,
on the equation workfile estimated above View/Coefficient Diagnostics/Bounds Test, then you
will obtain the following test result:
As can be seen from the test result above, the F-statistic is higher than the upper bounds test
critical value even at 1% level of significance. Therefore, we reject the null hypothesis of no long
run relationship. Right in such cases, we can estimate both the SHORT RUN and LONG RUN
Models. So, consider step-7.
Error
Correction
Term Short Run
Estimates
Long Run
Estimates