Econometrics Chapter 1 UNAV
Econometrics Chapter 1 UNAV
Econometrics Chapter 1 UNAV
(TIME SERIES)
CONTENT:
1. INTRODUCTION
3. ESTIMATION
4. HYPOTHESIS TESTING
5. MODEL SELECTION
6. SEASONALITY
7. PREDICTION
14. COINTEGRATION
Bibliography:
*. G.E.P. Box and G.M. Jenkins, Time series analysis. Forecasting and control. San
Francisco. Holden-Day (1970).
*. Aznar, A. y Trivez, F.J., Métodos de predicción en Economía II. Análisis de series temporales,
Ariel, Economía (1993).
1
2
1. INTRODUCTION
Time series análisis is not reduced to Economics. In fact, it is also studied in many other
areas such as Meteorology, Medicine, Biostatistics, Astronomy, Political Sciences, etc.
Find a mathematical model to explain the behaviour of the time series, in order to
Basic concepts:
3
Time series: y1, y2, y3, …, yT
We treat each observation (data) as if it were a random variable, such that we identify
the time series with the stochastic process
A common assumption in time series is to assume that all variables (that is, all the
observations are i.i.d., = independent and identically distributed).
Given that we treat all the observations as random variables, we need to define their
moments:
However, given that in most cases we only have a single realization available for each
of the random variables, we need to impose some restrictions to make these concepts
feasible. The basic concept here is the one called STATIONARITY.
* Stationarity
A stochastic process (or a time series) is said to be stationary (in a weak sense or
stationary of order 2) if it satisfies the following three properties:
In other words, the mean and the variance do not depend on time, and the covariance
between any two observations only depends on the distance between them, but not on
the specific location in time.
4
Thus, given the time series
under stationarity,
Cov(y1, y4) = Cov(y2, y5) = Cov(y4, y7) = … = Cov(y10, y13) = etc. = γ3.
*.
*.
*.
Though we do not properly define ergodicity, this property requires that observations
which are distant apart will tend to be uncorrelated. That is, a sufficient condition for
ergodicity is:
γk → 0 as k → ∞.
Note that:
F(y1, y2, y3, y4, …, yT) = F(y1+c, y2+c, y3+c, y4+c, …, yT+c) for all T and c,
Note that while the definition of weak stationarity is based on moments, the definition
of stationarity in strict sense is based on the distribution function.
5
Thus, the two definitions are independent and the only relation between them is given
by:
Across this course, we mainly work with stationary (in weak sense or order 2) series.
However, most of economic time series are not stationary, and, we will have to
transform them to render stationarity
1,55
1,5
1,45
1,4
1,35
1,3
1,25
1,2
1 T
2000
1000
-1000 6
-2000
7.Jan.86 31.Dec.97
Index of the Hong-Kong (Hang-Seng) stock market index (daily data)
The simplest example of a stationary process is the WHITE NOISE process. Generally,
it is denoted as εt.
2 4
1
2
0
0
-1
-2
-2
-3 -4
-4 -6
1 100 1 1000
If the time series is nonstationary, we will find a way to transform the time series in
another one that is stationary. Once the new series is found to be stationary, we will
look for the mathematical model that best describes the behaviour of the series,
such that the part that is un-modelled is precisely a white noise process..
7
Then,
yt = f(*) + εt,
where f is the mathematical function that explain the series and ε t is a white noise
process.
and, in general,
Thus, we observe that the mean, the variance, and the covariance structure do not
depend on time, so the series yt is stationary.
If yt is stationary,
Similarly, we define
8
autocorrelation function
In the previous example, (yt = εt + θ εt-1), we get the following values for the
autocorrelation structure (Exercise 1.3):
for all k ≥ 2.
(sample mean)
(sample variance)
(sample covariance).
(1.1)
Example:
9
Suppose we have a theoretical model that is a white noise process (ε t). Its
autocorrelation function (theoretical) will be given by the figure in the left-hand-side
below. However, let us suppose now that we have data, which have no structure, and we
compute its correlogram (sample autocorrelation function (1.1)). The values here (right-
hand-side plot), are similar to those given by the white noise model, and therefore we
can conclude that the time series follows a white noise process. (yt = εt)
1
1
0,8
0,8
0,6
0,6
0,4
0,4 0,2
0,2 0
-0,2
0 0 1 2 3 10
0 1 2 3 10
The correlogram tries to reproduce the theoretical autocorrelation function but it does
not imply to be the same. The correlogram will be the instrument employed to identify
the model.
Lk yt = yt-k
∆: First differences: ∆ = (1 – L)
∆ yt = (1 – L) yt = yt - yt-1
2. ARMA PROCESSES
10
2. Moving Average Processes (MA)
The combination of the two processes leads to a new process called ARMA
(AutoRegressive + Moving Average).
Before starting with the processes, we define a fundamental Theorem in Time Series
Analysis:
“Any stationary process of order 2, y t, can be uniquely represented as the sum of two
processes mutually uncorrelated, (vt and wt), such that:
yt = vt + wt,
with
In general (and in particular, in this chapter), we focus on the stochastic part (wt).
ARMA PROCESSES
(2.1)
(2.2)
11
(2.3)
(2.4)
or
(2.5)
since if then as n → ∞.
An alternative way of getting the same result is using the lag operator:
it can be represented as
or
12
(2.6)
If │x│ < 1,
such that, if
(2.7)
Noting that in stationary processes, the mean is constant, (μ), and that E(εt) = 0, we get
13
(2.8
)
again here, given that in stationary processes, the variance of yt is constant (and we
denote it by γo), looking at (2.8) we get:
+ 0,
(2.9)
The last term in (2.9) is 0, given that a stationary AR(1) process depends exclusively on
εt, εt-1, εt-2, … and thus, it is uncorrelated with εt+1. Then, we obtain that:
14
and, in general
and we see that the decay in the autocorrelation function follows an exponential process.
We first suppose that is a positive value. If that value is close to 1 ( = 0.9) the
decay in the autocorrelation function will be slow. On the contrary, if is close to 0,
(e.g. = 0.2), the decay is very fast, and the values become fast close to. On the other
hand, given that is positive, all the values in the autocorrelation function are
positive.
If, on the contrary, is negative, we get the same exponential decay to 0, depending on
the magnitude of . However, such decayment oscillates, from postive to negative
values.
0.2
1 0,25
0,9
0,8 0,2
0,7
0,6 0,15
0,5
0,4 0,1
0,3
0,2 0,05
0,1
0 0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
15
1
0,8
0,6
0,4
0,2
0
-0,2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-0,4
-0,6
-0,8
-1
Later on, we will study higher order autoregressive (AR) processes, e.g., AR(2), AR(3)
and in general AR(p) processes.
(2.10)
Given (2.10),
16
Similarly, it can be proved that
Finally, its graphical representation will consist on a unique value (positive or negative)
depending on the sing of θ.
0.2
0,6
0,5
0,4
0,3
0,2
0,1
0
1 3 5 7 9 11 13 15 17 19
17
Once more, if we are working with data, and the correlogram shows a plot similar to
one of these graphics, we can conclude that the time series follows a MA(1) process.
We have said before that the MA(1) processes (and in general any MA process) are
always stationary. Sometimes, it is desirable the process to be invertible, that means that
the process admits an AR(∞) representation. Then, it will require that < 1
(Invertibility condition). Then, it can be shown that,
(2.11)
so (2.11) becomnes:
or
*. AR(2) processes
18
(2.12)
(2.13)
Next, we look at the conditions that are required for an AR(2) process to be stationary.
Next, if we invert it (in the sense that we write which is in the right in the left and
viceversa) and substitute x by z, we get the following equation:
which is a second order equation (in standard form), and we can compute its roots, z 1
and z2,
y . (2.14)
In other words, the stationarity condition in AR(2) processes is that “the roots of the
“inverted” polynomial must be both smaller than 1 in absolute value”.
Example:
(2.15)
19
and writing the polynomial in terms of x and equalizing it to 0:
1.10 and -
0.89.
Given that one of the roots (1.10) is above 1 in absolute value, the process given by
(2.15) is non-stationary.
----------------------------------------------------------------------------------------------------------
We have just said that the stationarity condition in AR(2) process is that the roots
and .
( )
z1 = a + b i
20
z2 = a - b i
(2.16)
Using this last relationship (2.16), we get that yt in (2.12) can also be expressed in the
following way:
where
21
Example:
0.2
and -0.4.
Given that the two roots are smaller than 1 in absolute value, the process is stationary.
such that
22
Next we look at an alternative way to determine if an AR(2) process is stationary or not.
For this purpose we use now the coefficients of the process. In particular, an AR(2)
process is stationary if the coefficients in the model satisfy the following three
properties:
1.
2.
3.
If one of these conditions is not satisfied, the process will not be stationary.
Thus, all the values of and that lie within the triangle will imply stationarity.
Moreover, if we draw, within the triangle, the curve , we can also
distinguish the real roots from the complex ones.
23
Finally, we look at the statistical properties of the stationary AR(2) processes:
24
and given that we obtain
and, in general,
(2.17)
(2.18)
such that,
etc.
These values can be obtained from (2.18), taking into account that ρk = ρ-k and ρo = 1.
25
*. MA(2) processes
(2.19)
or
26
for all s > 2.
Thus, the autocorrelation function of MA(2) processes is null for lags higher than 2.
Let’s see some examples in graphical terms:
*. ARMA(1, 1) processes
(2.20)
or
stationary if:
27
Next we look at the statistical properties of the stationary ARMA(1, 1) processes.
Given (2.20):
We get:
we get that:
Similarly,
28
and, in general, for all s > 1
Thus, for s > 1, we get the same structure as in purely AR(1) processes. Generalizing all
the previous processes, we have
*. AR(p) processes
(2.21)
or
where
Next we look at the autocovariance and the autocorrelation structures. Given (2.21):
29
Instead of looking at the variance, (γo), we look at the autocovariances for a given value
k. For this purpose, we first multiply both sides in (2.21) by yt-k, such that
and next we calculate the mathematical expectation, (E(.)), in both sides of the previous
equality, that is,
Taking into account that the means are 0, we can re-write that expression as:
.
(2.22)
...
That is, we have p equations to solve p unknowns (ρ1, …, ρp), which is sufficient to
calculate the autocorrelation function. This system of equations is known as the YULE-
WALKER equations.
*. MA(q) processes
30
or
where
if k = 0,
if k = 1, 2, …, q,
0 if k > q.
1 if k = 0,
if k = 1, 2, …, q,
31
0 if k > q.
Thus, the autocorrelation function of a MA(q) process is null for lags above q. This is a
very useful results noting that when we compute the correlogram of a given time series,
if it is close to 0 from a given lag, we can easily identify it as a MA process. For
instance, if the correlogram adopts the graphic in the left (Series 1) we can suggest that
the model that is behind the data is a MA(5), while the correlogram in the right hand
side might correspond to a MA(2) process.
Series 1 Series 2
1,2 1,2
0,8
0,8
0,4
3
0 0,4
0 1 2 4 5 0 1 2
-0,4 4
0
-0,8 0 1 2
-1,2 -0,4
*. ARMA(p, q) process
or
32
are smaller than 1 in absolute value. Similarly, the process will be invertible if the q
roots of the polynomial:
and
such that
k = q + 1, q + 2, …
That is, for lags above q, the autocorrelation function does not take into account the
contribution from the MA part, and thus, its behaviour from lag q is the same as in an
AR(p) process.
We have seen before that it is quite easy to detect MA(q) processes from the
correlogram. In fact, it is simply to observe from which lag the values are close to 0.
Thus, for example, if the values in the correlogram are approximately 0 in lag 4 and in
all the following ones, the time series may be described as a MA(3) process.
However, to detect AR(p) processes from the correlogram is not an easy task since the
autocorrelation function substantially changes depending on the parameters of the
model Here, we can use another instrument that is called partial correlogram.
33
and sucesively up to
As you can see, all of them are AR processes with orders that are increasing from one
process to another. The sucession of values
is called the Partial Autocorrelation Function, and is formed by the series of the last AR
coefficients which are sucessively higher.
If, instead of , we use the estimators of such values, , the sucession of values
Example:
Let us suppose that the partial correlograms of the following series 3 and 4 adopt the
following form
:
Series 3 Series 4
34
1,2 1,2
0,8
0,8
0,4
3
0 0,4
0 1 2 4 5 0 1 2
-0,4 4
0
-0,8 0 1 2
-1,2 -0,4
Then, we can conclude by saying that Series 3 follows an AR(5) process, while Series 4
follows an AR(2) process.
Given the time series {y1, y2, y3, …, yT}, we can study its statistical properties from a
matritial viewpoint.
where
35
Now, if we assume stationarity of order 2(i.e., covariance stationary), that is,
This type of matrices, (where all the elements across the diagonals are equal) are called
TOEPLITZ matrices.
Adic. 3: Nonstationarity
At the beginning of this course we said that most economic time series are of a
nonstationary nature.
Here we briefly present two alterantive ways of transforming a time series that is
nonstationary into stationary.
A usual way (at least until the 80s) of describing the nonstationarity was to employ
deterministic functions (generally linear or quadratic) in time. That is, you can regress y t
on a variable “t” that describes a linear trend, or to regress it on the variables “t” y “t 2”
(quadratic function), assuming that the resulting residuals are stationary. Thus, for
example, if the time series is of form
36
a way of modelling this series would be:
such that once the parameters are estimated, ( y , the resulting residuals are
stationary and can be modelled using the ARMA models:
(2.23)
In other words, what we do is to use a linear trend such that the discrepancies between
the observed values and the estimated ones form the linear trend are stationary. This
type of transformations is usually called the “deterministic approach”.
ut = (1 - L) yt = yt - yt-1 .
Assuming that ut is now stationary, we proceed to study its ARMA structure in the same
way as in (2.23). This approach is called the “stochastic approach” and will be studied
in detail in future chapters.
where
is the AR polynomial of order p,
37
38