+ - 0:00:00
Notes for current slide
Notes for next slide

IM532 3.0 Applied Time Series Forecasting

MSc in Industrial Mathematics

Introduction to ARIMA models

8 March 2020

1 / 38

Stochastic processes

"A statistical phenomenon that evolves in time according to probabilistic laws is called a stochastic process." (Box, George EP, et al. Time series analysis: forecasting and control.)

2 / 38

Stochastic processes

"A statistical phenomenon that evolves in time according to probabilistic laws is called a stochastic process." (Box, George EP, et al. Time series analysis: forecasting and control.)

Non-deterministic time series or statistical time series

A sample realization from an infinite population of time series that could have been generated by a stochastic process.

2 / 38

Stochastic processes

"A statistical phenomenon that evolves in time according to probabilistic laws is called a stochastic process." (Box, George EP, et al. Time series analysis: forecasting and control.)

Non-deterministic time series or statistical time series

A sample realization from an infinite population of time series that could have been generated by a stochastic process.

Probabilistic time series model

Let {X1,X2,...} be a sequence of random variables. Then the joint distribution of the random vector [X1,X2,...,Xn] is

P[X1x1,X2x2,...,Xnxn]

where <x1,...,xn< and n=1,2,...

2 / 38

Mean function

3 / 38

Mean function

The mean function of {Xt} is

μX(t)=E(Xt).

3 / 38

Mean function

The mean function of {Xt} is

μX(t)=E(Xt).

Covariance function

The covariance function of {Xt} is

γX(r,s)=Cov(Xr,Xs)=E[(XrμX(r))(XsμX(s))]

for all integers r and s.

3 / 38

Mean function

The mean function of {Xt} is

μX(t)=E(Xt).

Covariance function

The covariance function of {Xt} is

γX(r,s)=Cov(Xr,Xs)=E[(XrμX(r))(XsμX(s))]

for all integers r and s.

The covariance function of {Xt} at lag h is defined by γX(h):=γX(h,0)=γ(t+h,t)=Cov(Xt+h,Xt).

3 / 38

Autocovariance function

The auto covariance function of Xt at lag h is

γX(h)=Cov(Xt+h,Xt).

4 / 38

Autocovariance function

The auto covariance function of Xt at lag h is

γX(h)=Cov(Xt+h,Xt).

Autocorrelation function

The autocorrelation function of Xt at lag h is

ρX(h)=γX(h)γX(0)=Cor(Xt+h,Xt).

4 / 38

Weekly stationary

A time series {Xt} is called weekly stationary if

  • μX(t) is independent of t.

  • γX(t+h,t) is independent of t for each h.

In other words the statistical properties of the time series (mean, variance, autocorrelation, etc.) do not depend on the time at which the series is observed, that is no trend or seasonality. However, a time series with cyclic behaviour (but with no trend or seasonality) is stationary.

5 / 38

Weekly stationary

A time series {Xt} is called weekly stationary if

  • μX(t) is independent of t.

  • γX(t+h,t) is independent of t for each h.

In other words the statistical properties of the time series (mean, variance, autocorrelation, etc.) do not depend on the time at which the series is observed, that is no trend or seasonality. However, a time series with cyclic behaviour (but with no trend or seasonality) is stationary.

Strict stationarity of a time series

A time series {Xt} is called weekly stationary if the random vector [X1,X2...,Xn] and [X1+h,X2+h...,Xn+h] have the same joint distribution for all integers h and n>0.

5 / 38

Simple time series models

1. iid noise

  1. no trend or seasonal component

  2. observations are independent and identically distributed (iid) random variables with zero mean.

  3. Notation: {Xt}IID(0,σ2)

  4. plays an important role as a building block for more complicated time series.


Joint distribution function of iid noise

P[X1x1,X2x2,...,Xnxn]=P[X1x1]....P[Xnxn].

6 / 38

Simple time series models

1. iid noise

  1. no trend or seasonal component

  2. observations are independent and identically distributed (iid) random variables with zero mean.

  3. Notation: {Xt}IID(0,σ2)

  4. plays an important role as a building block for more complicated time series.


Joint distribution function of iid noise

P[X1x1,X2x2,...,Xnxn]=P[X1x1]....P[Xnxn]. Let FX(.) be the cumulative distribution function of each of the identically distributed random variables X1,X2,... Then, P[X1x1,X2x2,...,Xnxn]=FX(x1)...FX(xn)

6 / 38

Simple time series models

1. iid noise

  1. no trend or seasonal component

  2. observations are independent and identically distributed (iid) random variables with zero mean.

  3. Notation: {Xt}IID(0,σ2)

  4. plays an important role as a building block for more complicated time series.


Joint distribution function of iid noise

P[X1x1,X2x2,...,Xnxn]=P[X1x1]....P[Xnxn]. Let FX(.) be the cumulative distribution function of each of the identically distributed random variables X1,X2,... Then, P[X1x1,X2x2,...,Xnxn]=FX(x1)...FX(xn) There is no dependence between observations. Hence, P[Xn+hx|X1=x1,...,Xn=xn]=P[Xn+hx].

6 / 38

iid noise (cont.)

Examples of iid noise

  1. Sequence of iid random variables {Xt,t=1,2,...} with P(Xt=1)=12 and P(Xt=0)=12.

rnorm(15)
[1] 2.61665472 -1.47748881 -0.75695121 -1.70520956 -1.02075354 0.81739417
[7] 0.01909737 -1.29025062 0.84205925 0.27636792 -1.37133390 -0.89830051
[13] -0.62070173 0.15142641 0.40849453
7 / 38

iid noise (cont.)

Examples of iid noise

  1. Sequence of iid random variables {Xt,t=1,2,...} with P(Xt=1)=12 and P(Xt=0)=12.

rnorm(15)
[1] 2.61665472 -1.47748881 -0.75695121 -1.70520956 -1.02075354 0.81739417
[7] 0.01909737 -1.29025062 0.84205925 0.27636792 -1.37133390 -0.89830051
[13] -0.62070173 0.15142641 0.40849453

Question

Let {Xt} is a iid noise with E(X2)=σ2<. Show that {Xt} is a stationary process.

7 / 38

Simple time series models

2. White noise

If {Xt} is a sequence of uncorrelated random variables, each with zero mean and variance σ2, then such a sequence is referred to as white noise.

Note: Every IID(0,σ2) sequence is WN(0,σ2) but not conversely.

8 / 38

Simple time series models

3. Random walk

A random walk process is obtained by cumulatively summing iid random variables. If {St,t=0,1,2,...} is a random walk process, then S0=0

S1=0+X1

S2=0+X1+X2

...

St=X1+X2+...+Xt.

9 / 38

Simple time series models

3. Random walk

A random walk process is obtained by cumulatively summing iid random variables. If {St,t=0,1,2,...} is a random walk process, then S0=0

S1=0+X1

S2=0+X1+X2

...

St=X1+X2+...+Xt.

Question

Is {St,t=0,1,2,...} a weak stationary process?

9 / 38

Identifying non-stationarity in the mean

  • Using time series plot

  • ACF plot

    • ACF of stationary time series will drop to relatively quickly.

    • The ACF of non-stationary series decreases slowly.

    • For non-stationary series, the ACF at lag 1 is often large and positive.

10 / 38

Elimination of Trend and Seasonality by Differencing

  • Differencing helps to stabilize the mean.

Backshift notation:

BXt=Xt1

Ordinary differencing

The first-order differencing can be defined as

Xt=XtXt1=XtBXt=(1B)Xt where =1B.

The second-order differencing

2Xt=(Xt)=(XtXt1)=XtXt1=(XtXt1)(Xt1Xt2)

  • In practice, we seldom need to go beyond second order differencing.
11 / 38

Seasonal differencing

  • differencing between an observation and the corresponding observation from the previous year.

mXt=XtXtm=(1Bm)Xt where m is the number of seasons. For monthly, m=12, for quarterly m=4.

For monthly series

12Xt=XtXt12

Twice-differenced series

122Xt=12Xt12Xt1=(XtXt12)(Xt1Xt13)

If seasonality is strong, the seasonal differencing should be done first.

12 / 38

Original series

Differenced series

  • For a stationary time series, the ACF will drop to zero relatively quickly, while the ACF of non-stationary data decreases slowly.
13 / 38

Original series

Differenced series

14 / 38

Original series

Seasonal Differencing

15 / 38

Linear filter model

A linear filter is an operation L which transform the white noise process into another time series {Xt}.

White noise ϵt Linear Filter ψ(B) Output Xt

16 / 38

Autoregressive models

current value = linear combination of past values + current error

An autoregressive model of order p, AR(P) model can be written as

xt=c+ϕ1xt1+ϕ2xt2+...+ϕpxtp+ϵt, where ϵt is white noise.

  • Similar to multiple linear regression model but with lagged values of xt as predictors.
17 / 38

Autoregressive models

current value = linear combination of past values + current error

An autoregressive model of order p, AR(P) model can be written as

xt=c+ϕ1xt1+ϕ2xt2+...+ϕpxtp+ϵt, where ϵt is white noise.

  • Similar to multiple linear regression model but with lagged values of xt as predictors.

Question

Show that AR(P) is a linear filter with transfer function ϕ1(B), where ϕ(B)=1ϕ1Bϕ2B2...ϕpBp.

17 / 38

Autoregressive models

current value = linear combination of past values + current error

An autoregressive model of order p, AR(P) model can be written as

xt=c+ϕ1xt1+ϕ2xt2+...+ϕpxtp+ϵt, where ϵt is white noise.

  • Similar to multiple linear regression model but with lagged values of xt as predictors.

Question

Show that AR(P) is a linear filter with transfer function ϕ1(B), where ϕ(B)=1ϕ1Bϕ2B2...ϕpBp.

Stationary condition for AR(P)

The roots of ϕ(B)=0 (characteristic equation) must lie outside the unit circle.

17 / 38

Stationarity Conditions for AR(1)

Let's consider AR(1) process,

xt=ϕ1xt1+ϵt.

Then,

(1ϕ1B)xt=ϵt.

This may be written as, xt=(1ϕ1B)1ϵt=j=0ϕ1jϵtj. Hence,

ψ(B)=(1ϕ1B)1=j=0ϕ1jBj

If |ϕ1|<1, the AR(1) process is stationary.

This is equivalent to saying the roots of 1ϕ1B=0 must lie outside the unit circle.

18 / 38

Geometric series

a+ar+ar2+ar3+...=a1r

for |r|<1.

19 / 38

AR(1) process

xt=c+ϕ1xt1+ϵt,

  • when ϕ1=0 - equivalent to white noise process

  • when ϕ1=0 and c=0 - random walk

  • when ϕ1=1 and c0 - random walk with drift

  • when ϕ1<0 - oscillates around the mean

20 / 38

Find the mean, variance and the autocorrelation function of a AR(1) process.

Help:

Cov(X+Y,X+Y)=Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y) Cov(X,Y)=E[(XμX)(YμY)]

21 / 38

Question: Properties of AR(2) process

Find the Mean, Variance and Autocorrelation function.

22 / 38

Yule-Walker Equations

Autoregressive parameters in terms of the autocorrelations.

23 / 38

Autocorrelation function of a AR(P) process

The autocorrelation function of AR(P) process

ρk=ϕ1ρk1+ϕ2ρk2+...+ϕpρkp for k>0.

This can be written as

ϕ(B)ρk=0, where ϕ(B)=1ϕ1B...ϕpBp.

For AR(1) process

ρk=ϕ1ρk1, for k>0. Since ρ0=1, for k1, we get

ρk=ϕ1k

  1. When ϕ1>0, autocorrelation function decays exponentially to zero.

  2. When ϕ1<0, autocorrelation function decays exponentially to zero and oscillates in sign.

24 / 38

Partial Autocorrelation Function

Conditional autocorrelation between Xt and Xtk given that Xt+1,Xt+2,...,Xt+k1.

Cor(Xt,Xt+k|Xt+1,Xt+2,...,Xt+k1)

The partial autocorrelation function ϕkk of AR(P) will be non-zero for k less than or equal to p and zero for k greater than p.

Calculations: in-class

25 / 38

Moving average models

Current value = linear combination of past forecast errors + current error

An MA(q) process can be written as

xt=c+ϵt+θ1ϵt1+θ2ϵt2+...+θpϵtq where ϵt is white noise.

  • The current value xt can be thought of as a weighted moving average of the past few forecast errors.

  • MA(q) is always stationary.

26 / 38

Moving average models

Current value = linear combination of past forecast errors + current error

An MA(q) process can be written as

xt=c+ϵt+θ1ϵt1+θ2ϵt2+...+θpϵtq where ϵt is white noise.

  • The current value xt can be thought of as a weighted moving average of the past few forecast errors.

  • MA(q) is always stationary.

  • Any AR(p) model can be written as an MA() model using repeated substitution.
26 / 38

Invertibility condition of an MA model

xt=c+ϵt+θ1ϵt1+θ2ϵt2+...+θpϵtq Using back shift operator, xt=c+ϵt+θ1Bϵt+θ2B2ϵt+...+θpBqϵt

Hence,

xt=θq(B)ϵt+c.

The θq is defined as an MA operator.

Any MA(q) process can be written as an AR() process if we impose some constraints on the MA parameters. Then it is called invertible.

MA model is called invertible if the roots of θq(B)=0 lie outside the unit circle.

27 / 38

MA(1) process

  1. Obtain the invertibility condition of MA(1) process.

  2. Calculate mean, variance, ACF and PACF of MA(1) process.

28 / 38

MA(2) process

Calculate mean, variance, ACF and PACF of MA(2) process.

29 / 38

ACF and PACF of AR(p) v MA(q) process

AR(p)

ACF: decays exponentially to zero.

PACF: PACF of AR(p) process is zero, beyond the order p of the process/ cut-off after lag p.

MA(q)

ACF: ACF of MA(q) process is zero, beyond the order q of the process/ cut-off after lag q.

PACF: decays exponentially to zero.

30 / 38

ARMA process

current value = linear combination of past values + linear combination of past error + current error

The ARMA(p,q) can be written as

Xt=c+ϕ1xt1+ϕ2xt2+...+ϕpxtp+θ1ϵt1+θ2ϵt2+...+θqϵtq+ϵt, where {ϵt} is a white noise process.

Using the back shift operator

ϕ(B)xt=θ(B)ϵt, where ϕ(.) and θ(.) are the pth and qth degree polynomials,

ϕ(B)=1ϕ1ϵ...ϕpϵp, and θ(B)=1+θ1ϵ+...+θqϵq.

31 / 38

ARMA(p, q) process

Stationary condition

Roots of ϕ(B)=0 lie outside the unit circle.

Invertible condition

Roots of θ(B)=0 lie outside the unit circle.

32 / 38

Question:

Determine which of the following processes are invertible and stationary.

  1. xt=0.6xt1+ϵt

  2. xt=ϵt1.3ϵt1+0.4ϵt2

  3. xt=0.6xt11.3ϵt1+0.4ϵt2+ϵt

  4. xt=xt11.3ϵt1+0.3ϵt2+xt

33 / 38

ARMA(1, 1) model

Calculate the mean,variance and ACF of ARMA(1, 1) process.

34 / 38

Non-seasonal ARIMA models

  • Autoregressive Integrated Moving Average Model

xt=c+ϕ1xt1+...+ϕpxtp+θ1ϵt1+...+θqϵtq+ϵt, where xt is the difference series.

Using the back shift notation

(1ϕ1B...ϕpBp)(1B)dxt=c+(1+θ1B+...+θqBq)ϵt

  • We call this an ARIMA(p,d,q) model.

    • p - order of the autoregressive part

    • d - degree of first differencing involved

    • q - order of the moving average part

35 / 38

Seasonal ARIMA model

Seasonal differencing

For monthly series

(1B12)xt=xtxt12

For quarterly series

(1B4)xt=xtxt4

Non-seasonal differencing

(1B)xt=xtxt1

Multiply terms together

(1B)(1Bm)xt=(1BBm+Bm+1)xt=xtxt1xtm+xtm1.

36 / 38

Seasonal ARIMA models

ARMA(p,d,q)(P,D,Q)m

  • (p,d,q) - non-seasonal part of the model

  • (P,D,Q) - seasonal part of the model

  • m - number of observations per year

ARIMA(1,1,1)(1,1,1)4

(1ϕ1B)(1Φ1B4)(1B)(1B4)xt=(1+θ1B)(1+Θ1B4)ϵt

(1ϕ1B) - Non-seasonal AR(1)

(1Φ1B4) - Seasonal AR(1)

(1B) - Non-seasonal difference

(1B4) - Deasonal difference

(1+θ1B) - Non-seasonal MA(1)

(1+ΘB4) - Seasonal MA(1)

37 / 38

Question

  1. Write down the model for

ARIMA(0,0,1)(0,0,1)12 ARIMA(1,0,0)(1,0,0)12

38 / 38

Stochastic processes

"A statistical phenomenon that evolves in time according to probabilistic laws is called a stochastic process." (Box, George EP, et al. Time series analysis: forecasting and control.)

2 / 38
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
s Start & Stop the presentation timer
t Reset the presentation timer
?, h Toggle this help
Esc Back to slideshow