Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I...

22
Econometr´ ıa 2: An´ alisis de series de Tiempo Karoll GOMEZ [email protected] http://karollgomez.wordpress.com Segundo semestre 2016

Transcript of Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I...

Page 1: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Econometrıa 2: Analisis de series de Tiempo

Karoll [email protected]

http://karollgomez.wordpress.com

Segundo semestre 2016

Page 2: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

II. Basic definitions

Page 3: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Definitions

I A time series is a set of observations Xt , each one beingrecorded at a specific time t with 0 < t < T .

I In reality we can only observe the time series at a finitenumber of times, and in that case the underlying sequence ofrandom variables (X1,X2, ...,Xt) is just a an t-dimensionalrandom variable (or random vector), i.e. finite number ofobservations.

Page 4: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Page 5: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Remark:

I The realization (the result or the observed value) of a randomvariable is a number.

I However, as it’s a random variable, we know that the numbercan take values from a given set according to some probabilitylaw.

I The same applies to stochastic process, but now therealization instead of being a single number is a sequence (ifthe process is discrete) or a function (if it’s continuous) ofrandom variables. Basically, a time series.

Page 6: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 1: In that case Xt , t = 1, 2, ... is called a discretestochastic process. In order to specify its statistical properties wethen need to consider all t-dimensional distributions:

P[X1 6 x1, ...,Xt 6 xt ] ∀ t = 1, 2, ...

DEFINITION 2: A time series model for the observed data Xt isa specification of the joint distributions (or possibly only the meansand covariances) of a sequence of random variables xt of which Xt

is postulated to be a realization.

Page 7: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 3: A process Xt , t ∈ Z is said to be an i.i.d noisewith mean 0 and variance σ2, written

Xt ∼ i .i .d(0, σ2)

if the random variables Xt are independent and identicallydistributed with E [Xt ] = 0 and Var(Xt) = σ2

A stochastic process with T ∈ Z is often called a time series (Zdenotes natural numbers).

Page 8: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 4: Let Xt , t ∈ Z be a stochastic process withVar(Xt) <∞,the mean function of Xt is:

µX (t) = E [Xt ] t ∈ T

the covariance function of Xt is:

γX (r , s) = Cov [Xr ,Xs ] r , s ∈ T

Page 9: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 5: The time series Xt , t ∈ Z is said to be (weakly)stationary process if:

Var(X (t)) <∞ ∀t ∈ T

µX (t) = µ t ∈ T

γX (r , s) = γX (r + t, s + t) r , s ∈ T

Loosely speaking, a stochastic process is stationary, if its statisticalproperties do not change with time.Notice also that the mean and variance must be finite.

Page 10: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 6: Let Xt , t ∈ Z be a (weakly) stationary time series.The autocovariance function of Xt is:

γX (τ) = Cov [Xt ,Xt−τ ]

The autocorrelation function (ACF) of Xt is:

ρX (τ) =γX (τ)

γX (0)

The value τ = r − s is referred to as the lag.

Page 11: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

NOTE: For non-stationary process:

The autocovariance function of Xt is:

γX (τ) = Cov [Xt ,Xt−τ ]

The autocorrelation function (ACF) is:

ρX (τ) =Cov [Xt ,Xt−τ ]√

Var [Xt ]√

Var [Xt−τ ]

The value τ = r − s is referred to as the lag.

Page 12: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Remarks:

1. A series Xt is said to be lagged if its time axis is shifted:shifting by k lags gives the series Xt−k .

2. A plot of ρt against the lag k = 1, 2, ...,m with m < T iscalled the correlogram

3. ρt values are −1 < ρt < 1

4. We use the sample to computecov(Xt ,Xt−1), cov(Xt ,Xt−2), ..., cov(Xt ,Xt−k)

Page 13: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Autocorrelation and autocorrelogram: more details

Page 14: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

NOTE: ck and rk correspond to estimated sample values for γ(τ) and ρ(τ)

Page 15: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Interpreting autocorrelogram

Page 16: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

Seasonal series

Page 17: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 7: The time series Xt , t ∈ Z is said to be whitenoise process with with mean µ and variance σ2, written:

Xt ∼WN(µ, σ2)

if:E [Xt ] = µ

γX (h) =σ2 if h = 0

0 if h 6= 0

Page 18: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 8: The time series Xt , t ∈ Z is said to be (strictly)stationary process if the distribution of :

(Xt1 , ...,Xtk ) and (Xt1+h, ...,Xtk+h)

are the same for all set of data points t1, ..., tk and all h ∈ Z .

Remarks:

I It means the joint distribution function is invariant under timeshifts.

I Weak stationarity rely only on properties defined by the meansand covariances, while strict stationarity rely only on alldistribution properties.

Page 19: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

I A strict stationary process Xt , t ∈ Z with Var(Xt) <∞ is saidto be stationary process.

I A stationary time series Xt , t ∈ Z does not need to bestrictly stationary.

Example: Xt is a sequence of independent variables and

Xt =EXP(1) if t is odd

N(1, 1) if t is even

Thus Xt is WN(1, 1) but not i .i .d(1, 1).

Page 20: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 9: The time series Xt , t ∈ Z is said to be Gaussiantime series if the all finite dimensional distribution are normal.

I A stationary Gaussian time series Xt , t ∈ Z is strictlystationary, since the normal distribution is determined by itsmean and its covariance.

Page 21: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 10: Let B be the backward shift operator, i.e.(BX )t = Xt−1.

I In the obvious way we define powers of B(B jX )t = Xt−j .

I The operator can be defined for linear combinations byB(c1Xt1 + c2Xt2) = c1Xt1−1 + c2Xt2−1

I Also as (αBk + βBh)Xt = αXt−k + βXt−h

I Strict stationarity means that BhX has the same distributionfor all h ∈ Z .

Page 22: Econometría 2: Análisis de series de Tiempo · Modelos de series de tiempo De nitions Remark: I The realization (the result or the observed value) of a random variable is a number.

Modelos de series de tiempoDefinitions

DEFINITION 11: Let ∇ the differencing operator, defined by∇Xt = (1− B)Xt = Xt − Xt−1

The power operator is defined as:

∇2Xt = ∇(∇Xt)

= ∇(Xt − Xt−1)

= (Xt − Xt−1)− (Xt−1 − Xt−2)

= Xt − 2Xt−1 − Xt−2