Professional Documents
Culture Documents
Ma1-And-Ma2 Time Series
Ma1-And-Ma2 Time Series
Al Nosedal
University of Toronto
February 5, 2019
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 1 / 47
First-order moving-average models
xt = wt + bwt−1
where wt is a white-noise series distributed with constant variance σw2 .
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 2 / 47
The Autocovariance for MA(1) Models
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 3 / 47
The Autocovariance for MA(1) Models
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 4 / 47
The Autocovariance for MA(1) Models
2
γ(0) = σMA = E (wt2 ) + bE (wt wt−1 ) + bE (wt−1 wt ) + b 2 E (wt−1
2
)
2
γ(0) = σMA = σw2 + 0 + 0 + b 2 σw2 = (1 + b 2 )σw2 .
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 5 / 47
The Autocovariance for MA(1) Models
Now set k = 1.
2
γ(1) = E (wt wt−1 ) + bE (wt wt−2 ) + bE (wt−1 wt−1 ) + b 2 E (wt−1 wt−2 )
γ(1) = bσw2 .
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 6 / 47
The Autocovariance for MA(1) Models
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 7 / 47
The Autocorrelation for MA(1) Models
γ(0)
ρ(0) = = 1.
γ(0)
γ(1) b
ρ(1) = = .
γ(0) 1 + b2
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 8 / 47
The Autocovariance for MA(q) Models
For the qth-order MA process, we can use a similar derivation to show that
the autocovariance function, γ(k), truncates after lag q. Once again
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 9 / 47
The Autocovariance for MA(q) Models
For k = 0, we obtain
2
γ(0) = σMA = (b02 + b12 + b22 + ... + bq2 )σw2 .
For k = 1, we obtain
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 10 / 47
The Autocovariance for MA(q) Models
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 11 / 47
Second-order Moving-Average Models
xt = wt + b1 wt−1 + b2 wt−2 ,
where wt is again a white-noise process.
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 12 / 47
MA(2), Autocovariance function
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 13 / 47
MA(2), Autocorrelation function
ρ(0) = 1
b1 +b1 b2
ρ(1) = 1+b 2 +b 2
1 2
b2
ρ(2) = 1+b12 +b22
ρ(k) = 0 for k > 2.
Thus, we see that the autocorrelation function for an MA(2) process
truncates after two lags.
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 14 / 47
MA(1) is an AR(∞)
xt = wt + bwt−1 .
Then,
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 15 / 47
MA(1) is an AR(∞)
This gives
xt = wt + b(xt−1 − bwt−2 )
= bxt−1 + wt − b 2 wt−2
(Now, we repeat the process with wt−2 )
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 16 / 47
MA(1) is an AR(∞)
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 17 / 47
MA(1) is an AR(∞)
We can continue indefinitely as long as b s goes to zero (i. e., |b| < 1) to
obtain
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 18 / 47
More about invertibility
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 19 / 47
More about invertibility
It can easily be shown that these two different processes have exactly the
same autocorrelation function (Right?)
γ(0)
ρ(0) = = 1.
γ(0)
γ(1) θ
ρ(1) = = .
γ(0) 1 + θ2
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 20 / 47
More about invertibility
If |θ| < 1, the series (AR(∞)) for A converges whereas that for B does
not. Thus if |θ| < 1, model A is said to be invertible whereas model B is
not. The imposition of the invertibility condition ensures that there
is a unique MA process for a given autocorrelation function.
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 21 / 47
Simulated Examples of the MA(1) Model
xt = wt + b1 wt−1
There are two cases, positive and negative values.
Case i) b1 = −0.7
Case ii) b1 = 0.3.
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 22 / 47
R Code
set.seed(9999);
# simulating MA(1);
ma1.sim<-arima.sim(list(ma = c( -0.7)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 23 / 47
Scatterplot
4
0
−6
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 24 / 47
Autocorrelation Function
acf(ma1.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 25 / 47
Autocorrelation Function, case i)
Series ma1.sim
0.8
ACF
0.2
−0.4
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 26 / 47
R Code
set.seed(9999);
# simulating MA(1);
ma1.sim<-arima.sim(list(ma = c(0.3)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 27 / 47
Scatterplot
4
0
−6
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 28 / 47
Autocorrelation Function, case ii)
acf(ma1.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 29 / 47
Autocorrelation Function, case ii)
Series ma1.sim
1.0
ACF
0.4
−0.2
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 30 / 47
Simulated Examples of the MA(2) Model
xt = wt + b1 wt−1 + b2 wt−2 .
Case i) b1 = 1.50 and b2 = −0.56
Case ii) b1 = 0.50 and b2 = 0.24
Case iii) b1 = −0.5 and b2 = 0.24
Case iv) b1 = 1.20 and b2 = −0.72
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 31 / 47
R Code
b1<- 1.5;
b2<- -0.56;
set.seed(9999);
# simulating MA(2);
ma2.sim<-arima.sim(list(ma = c(b1,b2)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 32 / 47
Scatterplot
MA(2), case i)
5 10
ma2.sim
−5 0
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 33 / 47
Autocorrelation Function, case i)
acf(ma2.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 34 / 47
Autocorrelation Function,case i)
Series ma2.sim
1.0
ACF
0.4
−0.2
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 35 / 47
R Code
b1<- 0.5;
b2<- 0.24;
set.seed(9999);
# simulating MA(2);
ma2.sim<-arima.sim(list(ma = c(b1,b2)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 36 / 47
Scatterplot
−5 0
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 37 / 47
Autocorrelation Function, case ii)
acf(ma2.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 38 / 47
Autocorrelation Function, case ii)
Series ma2.sim
1.0
ACF
0.4
−0.2
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 39 / 47
R Code
b1<- -0.5;
b2<- 0.24;
set.seed(9999);
# simulating MA(2);
ma2.sim<-arima.sim(list(ma = c(b1,b2)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 40 / 47
Scatterplot
−5 0
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 41 / 47
Autocorrelation Function, case iii)
acf(ma2.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 42 / 47
Autocorrelation Function, case iii)
Series ma2.sim
1.0
ACF
0.4
−0.2
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 43 / 47
R Code
b1<- 1.20;
b2<- -0.72;
set.seed(9999);
# simulating MA(2);
ma2.sim<-arima.sim(list(ma = c(b1,b2)),
n = 100, sd=2);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 44 / 47
Scatterplot
−5 0
0 20 40 60 80 100
Time
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 45 / 47
Autocorrelation Function, case iv)
acf(ma2.sim);
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 46 / 47
Autocorrelation Function
Series ma2.sim
1.0
ACF
0.4
−0.2
0 5 10 15 20
Lag
Al Nosedal University of Toronto The Moving Average Models MA(1) and MA(2) February 5, 2019 47 / 47