fundamentals of time series - victor...

31
Stochastic Processes Non- Stationary Process Moving Average Processes AutoRegressive Processes ARMA(1,1) Processes Conclusions Fundamentals of Time Series Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus Mundus MSc. Mathematical Modeling Victor Bernal Fundamentals of Time series 1 / 31

Upload: others

Post on 05-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Fundamentals of Time Series

Victor A. Bernal ArzolaBased on:

Prof. Zivot open ClassNotes

September, 2015Erasmus Mundus MSc. Mathematical Modeling

Victor Bernal Fundamentals of Time series 1 / 31

Page 2: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Outline

1 Stochastic Processes

2 Non- Stationary Process

3 Moving Average Processes

4 AutoRegressive Processes

5 ARMA(1,1) Processes

6 Conclusions

Victor Bernal Fundamentals of Time series 2 / 31

Page 3: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Introduction

Time series are sequences of data points, typically consisting ofsuccessive measurements made over a time interval.Time series are used in

statistics, econometrics, weather forecasting

mathematical finance and in any domain of applied scienceinvolving temporal measurements.

In this lecture we will discuss the Basics of Time Series for AR(1),MA(1), ARMA (1,1)

Victor Bernal Fundamentals of Time series 3 / 31

Page 4: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Stochastic Process

A stochastic process

{Y1,Y2, ...Yt , ...} = {Yt}∞t=1

is a sequence of random variables indexed by time.

Victor Bernal Fundamentals of Time series 4 / 31

Page 5: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Stochastic Process (II)

A Realization of a stochastic process up to time T

{Y1 = y1,Y2 = y2, ...YT = yT} = {yt}Tt=1

is a sequence of data points yi indexed by time.

Victor Bernal Fundamentals of Time series 5 / 31

Page 6: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Stochastic Process

There are two important forms of stationarity:

strictly (or strong) stationarity

covariance (or weak) stationarity

Victor Bernal Fundamentals of Time series 6 / 31

Page 7: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Strictly Stationary Process

A stochastic process is strictly stationary if for any sett1, t2, t3, .., tr the joint probability distribution of{Yt1Yt2 , ...Ytr }does not change when shifted in time.

Strictly stationary example

{Y1,Y3,Y10} ∼ {Y5,Y7,Y14}

The Joint Distribution is Time shift Invariant!

Victor Bernal Fundamentals of Time series 7 / 31

Page 8: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Covariance Stationary Process

A stochastic process is Covariance Stationary if

E [Yt ] = µ ind t

var (Yt) = σ2 ind t

cov(Yt ,Yt−j) = γj depends j

the covariance between any two terms of the sequence dependsonly on the relative positions j of the two terms

Victor Bernal Fundamentals of Time series 8 / 31

Page 9: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Covariance Stationary Process II

The covariance cov(Yt ,Yt−j) = γj is a measure of the lineardependence direction for Yt ,Yt−j . And The Correlation ρj definedas

ρj =cov(Yt ,Yt−j)√var(Yt)var(Yt−j)

=γjσ2

measures its strenght and it satisfies

−1 ≤ ρj ≤ 1

Victor Bernal Fundamentals of Time series 9 / 31

Page 10: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Gaussian White Noise

A process{Yt}∞t=1 where Yt ∼ iid N(0, σ2

)is called Gaussian

White Noise GWN process and satisfies

E [Yt ] = 0 ind t

var (Yt) = σ2 ind t

cov(Yt ,Yt−j) = 0 for all j > 0 ind t

other types are Weak-WN (not ind but just uncorr.) andIndependent-WN (not gaussian but any distr.)

Victor Bernal Fundamentals of Time series 10 / 31

Page 11: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Covariance Stationary

Gaussian White Noise (II)

Figure: Gaussian White Noise GWN (0, 1)

Victor Bernal Fundamentals of Time series 11 / 31

Page 12: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Non- Stationary Process

In a Non- Stationary Process maybe the mean, the autocovarianceor both might depend ont. For Example,

Trending Process

Random Walk

Victor Bernal Fundamentals of Time series 12 / 31

Page 13: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

The Trending Process

The deterministic trending process is

Yt = β0 + β1t + εt

where

εt ∼ iid N(0, σ2

ε

)E [Yt ] = β0 + β1t

var (Yt) = E [εt ]2 = σ2

ε

the mean is a function of t.

Victor Bernal Fundamentals of Time series 13 / 31

Page 14: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

The Trending Process (II)

Figure: Deterministic trending Yt = 0.1 ∗ t + εt , εt ∼ N (0, 1)

Victor Bernal Fundamentals of Time series 14 / 31

Page 15: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Random Walk

The Random Walk is defined as

Yt = Yt−1 + εt

where

εt ∼ iid N(0, σ2

ε

)by recursive substitution

Yt = Y0+t∑

i=1

εi

Victor Bernal Fundamentals of Time series 15 / 31

Page 16: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Random Walk (II)

Random Walk

E [Yt ] = Y0

var (Yt) = t � σ2ε

the variance increase linearly as function of t.

Victor Bernal Fundamentals of Time series 16 / 31

Page 17: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Random Walk (III)

Figure: Random walk Yt = Yt−1 + εt , εt ∼ N (0, 1)

Victor Bernal Fundamentals of Time series 17 / 31

Page 18: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Example (II)

Let’s consider

Yt ∼ GWN (0, 1) X ∼ N (0, 1) s.t X ⊥ Yt

then Zt = Yt + X implies that

var (Zt) = 2 and cov (Zt ,Zt−j) = 1

⇒ ρj =cov(Yt ,Yt−j)√var(Yt)var(Yt−j)

=1

2

for all j . The correlation doesn’t vanish with time!

Victor Bernal Fundamentals of Time series 18 / 31

Page 19: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Moving Average Processes

MA(1) is a process in which the correlation last 1 time period

Yt = µ+ εt + θεt−1

εt ∼ iid N(0, σ2

ε

)

Victor Bernal Fundamentals of Time series 19 / 31

Page 20: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Moving Average Processes (II)

MA(1) satisfyE [Yt ] = µ

var (Yt) = σ2ε

(1 + θ2

)cov(Yt ,Yt−1) = θσ2

ε

Victor Bernal Fundamentals of Time series 20 / 31

Page 21: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Moving Average Processes (III)

corr(Yt ,Yt−1) =θ

(1 + θ2)

we can observe thatθ = 0 ρ = 0

θ > 0 ρ > 0

θ < 0 ρ < 0

|θ| = 1 |ρMAX | = 0.5

and that for any j bigger than 1

corr(Yt ,Yt−j) = 0

Victor Bernal Fundamentals of Time series 21 / 31

Page 22: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Moving Average Processes (IV)

Figure: MA(1) µ = 1, θ = 0.9 σ2ε = 1

Victor Bernal Fundamentals of Time series 22 / 31

Page 23: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

AutoRegressive Processes

AR(1) Model are

Yt = µ+ φ (Yt−1 − µ) + εt

εt ∼ iid N(0, σ2

ε

)now the correlation decays to zero progressively if

−1 < φ < 1

Victor Bernal Fundamentals of Time series 23 / 31

Page 24: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

AutoRegressive Processes (II)

For an AR(1) Model we have

E [Yt ] = µ

var (Yt) = σ2ε/(1−φ2)

cov(Yt ,Yt−1) =σ2εφ

(1− φ2)

corr(Yt ,Yt−1) = φ

Victor Bernal Fundamentals of Time series 24 / 31

Page 25: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

AutoRegressive Processes (III)

for any j bigger than 1

cov(Yt ,Yt−j) =σ2ε

(1− φ2)φj

corr(Yt ,Yt−j) = φj

limj→∞ φj = 0

the closer is φ to unity the stronger the correlation in time

Victor Bernal Fundamentals of Time series 25 / 31

Page 26: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

AutoRegressive Processes (IV)

it can be written in the linear regression form (useful for estimationusing least squares)

Yt = c + φYt−1 + εt

where

c = µ (1− φ)

Victor Bernal Fundamentals of Time series 26 / 31

Page 27: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

AutoRegressive Processes (V)

Figure: AR(1) µ = 1, θ = 0.9 σ2ε = 1

Victor Bernal Fundamentals of Time series 27 / 31

Page 28: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

ARMA(1,1)

An ARMA(1,1) process (sum of MA(1) and AR(1)) is written as

Yt = c + εt + φYt−1 + θεt−1

see that if φ = 0⇒ MA(1) and if θ = 0⇒ AR(1). Then

E [Yt ] = c + φE [Yt−1]

andE [Yt ] =

c

1− φ

Victor Bernal Fundamentals of Time series 28 / 31

Page 29: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

ARMA(1,1) II

Now the variance is

var (Yt) =

(1 + θ2 + 2φθ

)(1− φ2)

σ2ε

and

cov(Yt ,Yt−1) = φvar (Yt−1) + θσ2ε =

(φ+ θ) (1 + φθ)

(1− φ2)σ2ε

Victor Bernal Fundamentals of Time series 29 / 31

Page 30: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

Conclusions

We have studied the basic properties of Time Series Processes

MA(1)

AR(1)

ARMA(1,1)

Victor Bernal Fundamentals of Time series 30 / 31

Page 31: Fundamentals of Time Series - VICTOR BERNALvictor-bernal.weebly.com/uploads/5/3/6/9/53696137/time...Victor A. Bernal Arzola Based on: Prof. Zivot open ClassNotes September, 2015 Erasmus

institution-logo-filenameO

Stochastic ProcessesNon- Stationary Process

Moving Average ProcessesAutoRegressive Processes

ARMA(1,1) ProcessesConclusions

References

E. Zivot. Time Series Concepts. Manuscript for Introduction toComputational Finance. 2012

Victor Bernal Fundamentals of Time series 31 / 31