Anda di halaman 1dari 18

Moving average MA

Introduction
MA(1)
MA(q)
Application

Trang Nguyen, ISE-IU, Fall 2016

Introduction
The AR processes have infinite non-zero autocorrelation
coefficients that decay with the lag. The AR have a relative
long memory, with decreasing coefficients
A family of processes that have very short memory
property are the Moving Average (MA). MA processes are a
function of a finite and generally small, number of its past
innovations.
Later, we will combine the properties of the AR and MA
processes to define the ARMA process, which give us a very
broad and flexible family of stationary stochastic processes
useful in representing many time series.

Trang Nguyen, ISE-IU, Fall 2016

The first order moving average MA(1)

MA(1) is defined by a linear combination of the last two


innovations:

xt zt zt 1
where xt xt , zt WN (0, z2 ) with being the
mean of the process.
The MA(1) can be written with the operator notation:
xt (1 B) zt

The MA(1) is the sum of two stationary processes and


therefore MA(1) is always stationary, unlike AR.
Trang Nguyen, ISE-IU, Fall 2016

MA(1): assumption

Assumption: | | 1 , that the past innovation has less


weight than the present. Then, we say that the process
is invertible and, effect of the past values of the series
decreases with time.
Verify this property:
t 1

x t i x t i t z 0 zt
i 1

Note that, when | | 1 , the effect of x t i tends to


zero with i and the process is called invertible.

Trang Nguyen, ISE-IU, Fall 2016

MA(1): Expectation & Variance

Expectation:

Variance:

The first order Auto-covariance:

E ( xt ) 0, implies E xt
Var (x t ) x2 (1 2 ) z2

1 E ( xt xt 1 ) z2

The k order Auto-covariance:

k 0, for all k>1

Trang Nguyen, ISE-IU, Fall 2016

MA(1): Auto-correlation ACF

Auto correlation coefficients of an MA(1):

1
, k 0, for k>1
2
1
| 1 |

| |
1

1 2 2

Notice that

There is a duality between AR(1) and MA(1). The ACF of


MA(1) has a cutoff after lag 1. The ACF of AR(1) tails off
exponentially.

Trang Nguyen, ISE-IU, Fall 2016

MA(1) example

Consider MA(1):

x t 10 zt 0.7 zt 1 where zt

ACF

IID(0,1)

0.7
0.4698, and h 0 for h>1
2
1 0.7

Trang Nguyen, ISE-IU, Fall 2016

MA(1) example

Trang Nguyen, ISE-IU, Fall 2016

Second-order Moving Average MA(2)

The MA(2) defined by

xt zt 1 zt 1 2 zt 2
= (1- 1 B 2 B 2 )z t
is stationary for all 1 , 2
The MA(2) is invertible only if the roots of the
characteristic equation:
1 1 B 2 B 2 0
lie outside the unit circle, that is
2 1 1
2 1 1
1 2 1

Trang Nguyen, ISE-IU, Fall 2016

MA(2): ACF

The variance of the process is:

Var (x t ) 0 z2 (1 12 22 )

Auto correlation function:


1 (1 2 )
1
1 12 22
2
2
1 12 22

k 0, for all k >2

The ACF has a cutoff after lag 2.


Trang Nguyen, ISE-IU, Fall 2016

10

MA(2) example 1

MA(2): x t 10 zt 0.5 zt 1 + 0.3zt 2 where zt


ACF:

IID(0,1)

0.5 0.5*0.3
0.4851
2
2
1 0.5 0.3
0.3
2
0.2239
2
2
1 0.5 0.3
and h 0 for h>1

Trang Nguyen, ISE-IU, Fall 2016

11

MA(2) example 1

Trang Nguyen, ISE-IU, Fall 2016

12

MA(2): Example

MA(1) with yt=20+zt+0.8zt-1.


MA(2) with yt=zt-zt-1+0.8zt-2.
In both cases, zt is normally distributed white noise with
mean 0 and variance 1.

Trang Nguyen, ISE-IU, Fall 2016

13

MA(2) example 2

MA(2) time series 1: xt zt 0.5 zt 1 0.5 zt 2


MA(2) time series 2: xt zt 5 zt 1 5 zt 2
Trang Nguyen, ISE-IU, Fall 2016

14

MA(2) example 2

Trang Nguyen, ISE-IU, Fall 2016

15

Moving Average order q, MA(q)

The MA(q) is:


Zt

X t Z t 1Z t 1 ... q Z t q

WN (0, 2 )

Where
X is a linear combination of q+1 white noise variables and
t
we
say that it is q-correlated.
Operator notation:

X t (B) Zt
(B) 1 1 B 2 B 2 ... q B q

We say that the process is invertible if the roots of the


operator (B) 0 are, in modulus, greater than the unit.

An MA(q) is always stationary, as it is sum of stationary


processes.
Trang Nguyen, ISE-IU, Fall 2016

16

MA(q) : auto-covariance and auto-correlation

Auto-covariance:

0 (1 12 ... q2 ) 2
k ( k 1 k 1 ... q k q ) 2 for k=1,...,q
k 0

for k>q

Auto-correlation:
q

i k i

i 0

i 0

k 0

for k=1,...,q

2
i

for k>q
Trang Nguyen, ISE-IU, Fall 2016

17

Practice: R code for example


Example MA(1):
acfma1=ARMAacf(ma=c(0.7), lag.max=10)
# 10 lags of ACF for MA(1) with theta1 = 0.7

lags=0:10
#creates a variable named lags that ranges from 0 to 10.
plot(lags,acfma1,xlim=c(1,10), ylab="r",type="h", main = "ACF for
MA(1) with theta1 = 0.7")
abline (h=0)

#adds a horizontal axis to the plot


Trang Nguyen, ISE-IU, Fall 2016

18

Anda mungkin juga menyukai