0% found this document useful (0 votes)
61 views13 pages

f13hw2 Solutions

This document contains notes and solutions for homework problems from a time series analysis course. It addresses concepts like stationarity, mean functions, autocovariance functions, and whether processes are stationary. For example, it shows that taking the first difference of a stationary process results in another stationary process. It also analyzes several time series models and determines whether they are stationary by examining their mean and autocovariance functions.

Uploaded by

safa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views13 pages

f13hw2 Solutions

This document contains notes and solutions for homework problems from a time series analysis course. It addresses concepts like stationarity, mean functions, autocovariance functions, and whether processes are stationary. For example, it shows that taking the first difference of a stationary process results in another stationary process. It also analyzes several time series models and determines whether they are stationary by examining their mean and autocovariance functions.

Uploaded by

safa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

STAT 520

FORECASTING AND TIME SERIES


2013 FALL
Homework 02

1.
2.7.(a) Since {Yt } is a stationary process, it has constant mean µ over
time and autocovariance function γk which is free of t. Letting Wt = ∇Yt =
Yt − Yt−1 , we obtain the mean function of {Wt }

E(Wt ) = E(Yt − Yt−1 ) = E(Yt ) − E(Yt−1 ) = µ − µ = 0

which is constant over time t. The autocovariance function of {Wt }

Cov(Wt , Wt−k ) = Cov(Yt − Yt−1 , Yt−k − Yt−k−1 )


= Cov(Yt , Yt−k ) + Cov(Yt , −Yt−k−1 ) + Cov(−Yt−1 , Yt−k ) + Cov(−Yt−1 , −Yt−k−1 )
= Cov(Yt , Yt−k ) − Cov(Yt , Yt−k−1 ) − Cov(Yt−1 , Yt−k ) + Cov(Yt−1 , Yt−k−1 )
= γk − γk+1 − γk−1 + γk = −γk+1 + 2γk − γk−1

only depends on time lag k. So we conclude that {Wt } is stationary.


2.7.(b) From previous result, we know that the first difference of a sta-
tionary process is still stationary. In this case, since we proved that {Wt } is
stationary, then the first differences of {Wt }, {Ut }, are stationary as well.

2.9.(a) Suppose Yt = β0 +β1 t+Xt , where {Xt } is a zero-mean stationary


series with autocovariance function γk and β0 and β1 are constant. The mean
function of {Yt }

E(Yt ) = E(β0 + β1 t + Xt ) = β0 + β1 t + E(Xt ) = β0 + β1 t + 0 = β0 + β1 t

which is not constant over time t. Then {Yt } is not stationary.


Consider Wt = Yt − Yt−1 , we obtain the mean function of {Wt }

E(Wt ) = E(Yt − Yt−1 ) = E(Yt ) − E(Yt−1 )


= E(β0 + β1 t + Xt ) − E(β0 + β1 (t − 1) + Xt−1 )
= β0 + β1 t + E(Xt ) − β0 + β1 (t − 1) + E(Xt−1 )
= β0 + β1 t + 0 − β0 + β1 (t − 1) + 0 = β1

which is constant over time t.

1
The autocovariance function of {Wt }
Cov(Wt , Wt−k ) = Cov(Yt − Yt−1 , Yt−k − Yt−k−1 )
= Cov{β0 + β1 t + Xt − [β0 + β1 (t − 1) + Xt−1 ],
β0 + β1 (t − k) + Xt−k − [β0 + β1 (t − k − 1) + Xt−k−1 ]}
= Cov(Xt − Xt−1 , Xt−k − Xt−k−1 )
= Cov(Xt , Xt−k ) + Cov(Xt , −Xt−k−1 ) + Cov(−Xt−1 , Xt−k ) + Cov(−Xt−1 , −Xt−k−1 )
= Cov(Xt , Xt−k ) − Cov(Xt , Xt−k−1 ) − Cov(Xt−1 , Xt−k ) + Cov(Xt−1 , Xt−k−1 )
= γk − γk+1 − γk−1 + γk = −γk+1 + 2γk − γk−1
only depends on time lag k. We conclude that {Wt } is stationary.

2.10. Let {Xt } be a zero-mean, unit-variance stationary process with


autocorrelation function ρk . Suppose that µt is a nonconstant function and
that σt is a positive-valued nonconstant function. The observed series is
formed as Yt = µt + σt Xt .
2.10.(a) Here we obtain the mean function
E(Yt ) = E(µt + σt Xt ) = µt + σt E(Xt ) = µt + 0 = µt
and the autocovariance function
Cov(Yt , Yt−k ) = Cov(µt + σt Xt , µt−k + σt−k Xt−k )
= Cov(σt Xt , σt−k Xt−k ) = σt σt−k Cov(Xt , Xt−k )
( √ )
= σt σt−k Corr(Xt , Xt−k ) V ar(Xt ) V ar(Xt−k )
( √ )
= σt σt−k ρk (1)(1) = σt σt−k ρk .

2.10.(b) It is easy to obtain V ar(Yt ) = V ar(µt + σt Xt ) = V ar(σt Xt ) =


σt2 V ar(Xt ) = σt2 (1) = σt2 , then the autocorrelation function
Cov(Yt , Yt−k )
Corr(Yt , Yt−k ) = √
V ar(Yt ) V ar(Yt−k )
σt σt−k ρk σt σt−k ρk
= √ = = ρk
2 2
σ σ σ t σ t−k
t t−k

only depends on time lag k. However, {Yt } is not stationary because the
mean function µt is not constant over time t.

2
2.10.(c) If we change the setting such that µt = µ which is constant over
time t, then Wt = µ+σt Xt has constant mean function µ and autocovariance
function Cov(Wt , Wt−k ) = σt σt−k ρk by similar calculation above. Since the
autocovariance function depends on time t, then {Wt } is not stationary.
However, it has constant mean µ over time t.

2.13 Let Yt = et − θ(et−1 )2 , where et s are independent and identically


distributed (IID) random variables which follow N (0, σe2 ) distribution. Then
e2t /σe2 are IID random variables which follow chi-squared distribution with 1
degree of freedom with E(e2t /σe2 ) = 1 and V ar(e2t /σe2 ) = 2. In other words,
E(e2t ) = σe2 and V ar(e2t ) = 2σe4 .
2.13.(a) First we obtain the autocovariance function

Cov(Yt , Yt−k ) = Cov(et − θ(et−1 )2 , et−k − θ(et−k−1 )2 )


= Cov(et , et−k ) + Cov(et , −θ(et−k−1 )2 ) + Cov(−θ(et−1 )2 , et−k )
+Cov(−θ(et−1 )2 , −θ(et−k−1 )2 )
= Cov(et , et−k ) + 0 + Cov(−θ(et−1 )2 , et−k ) + Cov(−θ(et−1 )2 , −θ(et−k−1 )2 )
= Cov(et , et−k ) − θCov((et−1 )2 , et−k ) + θ2 Cov((et−1 )2 , (et−k−1 )2 ).

If k = 0,

Cov(Yt , Yt ) = Cov(et , et ) − θCov((et−1 )2 , et ) + θ2 Cov((et−1 )2 , (et−1 )2 )


= V ar(et ) − 0 + θ2 V ar(e2t−1 ) = σe2 + θ2 (2σe4 ) = σe2 + 2θ2 σe4 .

If k = 1,

Cov(Yt , Yt−1 ) = Cov(et , et−1 ) − θCov((et−1 )2 , et−1 ) + θ2 Cov((et−1 )2 , (et−2 )2 )


= 0 − θE{[(et−1 )2 − E((et−1 )2 )][et−1 − E(et−1 )]} + 0
= −θE{[(et−1 )2 − 1][et − 0]}
= −θE{(et )3 − et } = −θE[(et )3 ] + E(et ) = 0 − 0 = 0.

where E[(et )3 ] = 0 because N (0, σe2 ) distribution is symmetric.


If k > 1,

Cov(Yt , Yt−1 ) = Cov(et , et−k ) − θCov((et−1 )2 , et−k ) + θ2 Cov((et−1 )2 , (et−k−1 )2 )


= 0 + 0 + 0 = 0.

3
Then the autocovariance function
{ 2
σe + 2θ2 σe4 for k = 0
γk = Cov(Yt , Yt−k ) =
0 for k ≥ 1
which only depends on time lag k. And the autocorrelation function
{
1 for k = 0
ρk = .
0 for k ≥ 1

2.13.(b) Here we obtain the mean function

E(Yt ) = E(et − θ(et−1 )2 ) = E(et ) − θE((et )2 ) = 0 − θ = −θσe2

which is free of time. Since the autocovariance function depends only on


time lag k and the mean function is constant over time t, we conclude that
{Yt } is stationary.

2.14.(a) For Yt = θ0 + tet , we have the mean function

E(Yt ) = E(θ0 + tet ) = θ0 + tE(et ) = θ0 + 0 = θ0

which is free of time. And the autocovariance function

Cov(Yt , Yt−k ) = Cov(θ0 + tet , θ0 + (t − k)et−k ) = Cov(tet , (t − k)et−k )


= t(t − k)Cov(et , et−k )
{ 2 2
t σe for k = 0
=
0 for k ≥ 1

which depends on time t. Then we conclude that {Yt } is stationary.


2.14.(b) For Wt = ∇Yt = Yt − Yt−1 , first we expand Wt as

Wt = ∇Yt = Yt − Yt−1 = θ0 + tet − (θ0 + (t − 1)et−1 )


= tet − (t − 1)et−1

and we have the mean function

E(Wt ) = E(tet − (t − 1)et−1 ) = tE(et ) − (t − 1)E(et−1 ) = 0 − 0 = 0

4
which is free of time t. And the autocovariance function
Cov(Wt , Wt−k ) = Cov(tet − (t − 1)et−1 , (t − k)et−k − (t − k − 1)et−k−1 )
= Cov(tet , (t − k)et−k ) + Cov(tet , −(t − k − 1)et−k−1 )
+Cov(−(t − 1)et−1 , (t − k)et−k ) + Cov(−(t − 1)et−1 , −(t − k − 1)et−k−1 )
= t(t − k)Cov(et , et−k ) − t(t − k − 1)Cov(et , et−k−1 )
−(t − 1)(t − k)Cov(et−1 , et−k ) + (t − 1)(t − k − 1)Cov(et−1 , et−k−1 ).
If k = 0,
Cov(Wt , Wt )
= t(t)Cov(et , et ) − t(t − 1)Cov(et , et−1 )
−(t − 1)(t)Cov(et−1 , et ) + (t − 1)(t − 1)Cov(et−1 , et−1 )
= t2 V ar(et ) − 0 − 0 + (t − 1)2 V ar(et−1 )
= t2 σe2 + (t − 1)2 σe2 = (2t2 − 2t + 1)σe2 .
If k = 1,
Cov(Wt , Wt−1 )
= t(t − 1)Cov(et , et−1 ) − t(t − 2)Cov(et , et−2 )
−(t − 1)(t − 1)Cov(et−1 , et−1 ) + (t − 1)(t − 2)Cov(et−1 , et−2 )
= 0 − 0 − (t − 1)2 V ar(et−1 ) + 0 = −(t − 1)2 σe2 .
If k > 1,
Cov(Wt , Wt−k )
= t(t − k)Cov(et , et−k ) − t(t − k − 1)Cov(et , et−k−1 )
−(t − 1)(t − k)Cov(et−1 , et−k ) + (t − 1)(t − k − 1)Cov(et−1 , et−k−1 )
= 0 − 0 − 0 + 0 = 0.
Then we obtain the autocovariance function

 (2t2 − 2t + 1)σe2 for k = 0
Cov(Wt , Wt−k ) = −(t − 1)2 σe2 for k = 1

0 for k > 1
which depends on time t. So we conclude that {Wt } is not stationary.
2.14.(c) For Yt = et et−1 , we have the mean function
E(Yt ) = E(et et−1 ) = E(et )E(et−1 ) = 0(0) = 0

5
which is free of time t.
And the autocovariance function
Cov(Yt , Yt−k ) = Cov(et et−1 , et−k et−k−1 )
= E(et et−1 et−k et−k−1 ) − E(et et−1 )E(et−k et−k−1 ).
If k = 0,
Cov(Yt , Yt ) = E(et et−1 et et−1 ) − E(et et−1 )E(et et−1 )
= E(e2t e2t−1 ) − [E(et et−1 )]2
= E(e2t )E(e2t−1 ) − [E(et et−1 )]2
= σe2 σe2 − [E(et )E(et−1 )]2 = σe4 − 02
= σe4 .
since σe2 = V ar(et ) = E(e2t ) − [E(et )]2 = E(e2t ) − 0 = E(e2t ) for all time t.
If k = 1,
Cov(Yt , Yt−1 ) = E(et et−1 et−1 et−2 ) − E(et et−1 )E(et−1 et−2 )
= E(et e2t−1 et−2 ) − E(et et−1 )E(et−1 et−2 )
= E(et )E(e2t−1 )E(et−2 ) − E(et )E(et−1 )E(et−1 )E(et−2 )
= 0(σe2 )(0) − 0(0)(0)(0) = 0 − 0
= 0.
If k > 0,
Cov(Yt , Yt−k ) = E(et et−1 et−k et−k−1 ) − E(et et−1 )E(et−k et−k−1 )
= E(et )E(et−1 )E(et−k )E(et−k−1 ) − E(et )E(tet−1 )E(et−k )E(et−k−1 )
= 0.
Then we obtain the autocovariance function
{ 4
σe for k = 0
Cov(Yt , Yt−k ) =
0 for k ≥ 1
which only depends on time lag k.
From previous results, we know that {Yt } has constant mean function
and autocovariance function which only depends on time lag k. Then we
conclude that {Yt } is stationary.

6
2.19. Let Y1 = θ0 + e1 , and then for t > 1, define Yt recursively by
Yt = θ0 + Yt−1 + et . Here θ0 is constant.
2.19.(a) Here we expand Yt for three times,

Yt = θ0 + Yt−1 + et = θ0 + (θ0 + Yt−2 + et−1 ) + et


= 2θ0 + Yt−2 + et−1 + et = 2θ0 + (θ0 + Yt−3 + et−2 ) + et−1 + et
= 3θ0 + Yt−3 + et−2 + et−1 + et .

Then we observe that after expanding t times, Yt can be rewrite as

Yt = tθ0 + et + · · · + e1 .

2.19.(b) Here we obtain the mean function

E(Yt ) = E(tθ0 + et + · · · e1 ) = tθ0 + E(et ) + · · · + E(e1 ) = tθ0 + 0 + · · · + 0 = tθ0 .

2.19.(c) The autocovariance function

Cov(Yt , Yt−k ) = Cov(tθ0 + et + · · · e1 , (t − k)θ0 + et−k + · · · e1 )


= Cov(et + · · · e1 , et−k + · · · e1 ).

For k = 0,

Cov(Yt , Yt ) = Cov(et + · · · e1 , et + · · · e1 ) = V ar(et + · · · e1 )


= V ar(et ) + · · · V ar(e1 ) = tσt .

For k ≥ 1,

Cov(Yt , Yt−k ) = Cov(et + · · · e1 , et−k + · · · e1 )


= Cov((et + · · · + et−k+1 ) + et−k + · · · + e1 , et−k + · · · + e1 )
= Cov(et + · · · + et−k+1 , et−k + · · · + e1 ) + Cov(et−k + · · · + e1 , et−k + · · · + e1 )
= 0 + V ar(et−k + · · · + e1 ) = V ar(et−k ) + · · · + V ar(e1 )
= (t − k)σe2 .

So we obtain the autocovariance function

Cov(Yt , Yt−k ) = (t − k)σe2 for k ≥ 0

which depends on time t and time lag k. Then we conclude that {Yt } is not
stationary.

7
2.(a) First, we obtain the mean function
E(Yt ) = E(Z1 cos(wt) + Z2 sin(wt) + et )
= E(Z1 ) cos(wt) + E(Z2 ) sin(wt) + E(et )
= 0+0+0=0
which is constant over time t.
Then we divide the autocovariance function into three parts
Cov(Yt , Yt−k )
= Cov(Z1 cos(wt) + Z2 sin(wt) + et , Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k )
= Cov(Z1 cos(wt), Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k ) (1)
+Cov(Z2 sin(wt), Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k ) (2)
+Cov(et , Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k ). (3)
For part (1),
Cov(Z1 cos(wt), Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k )
= Cov(Z1 cos(wt), Z1 cos(w(t − k))) + Cov(Z1 cos(wt), Z2 sin(w(t − k)))
+Cov(Z1 cos(wt), et−k )
= cos(wt) cos(w(t − k))Cov(Z1 , Z1 ) + cos(wt) sin(w(t − k))Cov(Z1 , Z2 )
+ cos(wt)Cov(Z1 , et−k )
= cos(wt) cos(w(t − k))V ar(Z1 ) + 0 + 0 = cos(wt) cos(w(t − k)).
For part (2),
Cov(Z2 sin(wt), Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k )
= Cov(Z2 sin(wt), Z1 cos(w(t − k))) + Cov(Z2 sin(wt), Z2 sin(w(t − k)))
+Cov(Z2 sin(wt), +et−k )
= sin(wt) cos(w(t − k))Cov(Z2 , Z1 ) + sin(wt) sin(w(t − k))Cov(Z2 , Z2 )
+ sin(wt)Cov(Z2 , +et−k )
= 0 + sin(wt) sin(w(t − k))V ar(Z2 ) + 0 = sin(wt) sin(w(t − k)).
For part (3),
Cov(et , Z1 cos(w(t − k)) + Z2 sin(w(t − k)) + et−k )
= Cov(et , Z1 cos(w(t − k)) + Cov(et , Z2 sin(w(t − k))) + Cov(et , et−k )
= 0 + 0 + Cov(et , et−k ) = Cov(et , et−k ).

8
Then we combine the results of all three parts and obtain the autocovari-
ance function
Cov(Yt , Yt−k ) = cos(wt) cos(w(t − k)) + sin(wt) sin(w(t − k)) + Cov(et , et−k )
= cos(wt − w(t − k)) = cos(wk) + Cov(et , et−k )
{
1 + σe2 for k = 0
=
cos(wk) for k ≥ 1.
According to calculations above, {Yt } has zero mean and autocovariance
function which is only depends on k. Then we conclude that {Yt } is station-
ary.
2.(b)
Please see Figure 1. There is trend in this graph. The observations
oscillate around zero between −4 to 4.
3
2
1
Trigonometric process

0
−1
−2
−3

0 50 100 150 200 250

Time

Figure 1: Time series plot for carbon dioxide data

The followings are R commands to make the graph above:

9
omega = 0.5
Z = rnorm(2,0.1)
e.t = rnorm(250,0,1)
Y.t = e.t*0
for (i in 1:length(e.t)){
Y.t[i] = Z[1]*cos(omega*i) + Z[2]*sin(omega*i) + e.t[i]}
plot(Y.t,ylab="Trigonometric process", xlab="Time", type="o")
2.(c) There is an increasing trend of the time series plot because of
adding the linear trend term β0 + β1 t to model. So we can see that the mean
function is not constant over time t and {Yt } appears not to be stationary.
115
110
Trig process with linear trend

105
100

0 50 100 150 200 250

Time

Figure 2: Time series plot for carbon dioxide data

The followings are R commands to make the graph above:


Y.tilde = e.t*0
for (i in 1:length(e.t)){
Y.tilde[i] = 100 + 0.05*i + Z[1]*cos(omega*i) + Z[2]*sin
(omega*i) + e.t[i]}

10
plot(Y.tilde, ylab="Trig process with linear trend", xlab="Time", type="o")

2.(d) The first differences process {∇Ỹt } looks to have trend. From
Problem 2.9, we know that this process must be stationary.
2
First differences of Y.tilde

0
−2

0 50 100 150 200 250

Time

Figure 3: Time series plot for carbon dioxide data

The followings are R commands to make the graph above:

diff.Y.tilde = diff(Y.tilde)
plot(diff.Y.tilde, ylab="First differences of Y.tilde", xlab="Time", type="o")

11
3.(i) Here we give an example of a process {Yt } with constant mean
but variance that increases with time. So we consider Yt = tet with mean
function

E(Yt ) = E(tet ) = tE(et ) = t(0) = 0

which is constant. However, the variance

V ar(Yt ) = V ar(tet ) = t2 V ar(et ) = t2 σe2

increases with time.

3.(ii) Here we give an example of a stationary process whose autoco-


variance does not go to zero as time lag goes to infinity. So we consider
2
Yt = X + et where X has mean zero and variance σX . X and white noise
process {et } are independent. Then we have the mean function of {Yt }

E(Yt ) = E(X + et ) = E(X) + E(et ) = 0 + 0 = 0

which is constant over time t. The autocovariance function

Cov(Yt , Yt−k ) = Cov(X + et , X + et−k )


= Cov(X, X) + Cov(X, et−k ) + Cov(et , X) + Cov(et , et−k )
= V ar(X) + 0 + 0 + Cov(et , et−k ) = V ar(X) + Cov(et , et−k )
{ 2
σX + σe2 for k = 0
= 2
σX for k ≥ 1

which only depends on time lag k. So we conclude that {Yt } is stationary.


But the autocovariance function does not go to zero as time lag k goes to
infinity.

3.(iii) Here we give an example of a nonstationary process {Yt } whose


autocovariance depends only on time lag k. So we consider Yt = t + et with
mean function

E(Yt ) = E(t + et ) = t + E(et ) = t + 0 = t

12
which is not free of time t. Then {Yt } is not stationary. Furthermore, we
obtain the autocovariance function

Cov(Yt , Yt−k ) = Cov(t + et , (t − k) + et−k ) = Cov(et , et−k )


{ 2
σe for k = 0
=
0 for k > 0
which depends only on time lag k.

3.(iv) Here we give an example of a process {Yt } that has nonzero


autocorrelation only at lag k = 1. Consider Yt = et −et−1 with mean function

E(Yt ) = E(et − et−1 ) = E(et ) − E(et−1 ) = 0 − 0 = 0

which is free of time t. First, we obtain the autocovariance function



 2σe2 for k = 0
Cov(Yt , Yt−k ) = −σe2 for k = 1 ,

0 for k ̸= 1, k > 0

which is free of time t. Then we conclude that {Yt } is stationary. (The


calculation of autocorrelation function is similar to Problem 2.12.. Please
refer to Homework 1.) Then the autocorrelation function

 1 for k = 0
ρk = − 1 for k = 1
 2
0 for k ̸= 1, k > 0
has nonzero autocorrelation only at lag k = 1.

3.(v) Here we give an example of a nonstationary process {Yt } whose first


differences are stationary. Consider the random process {Yt } which is given
by 2.19.(c) with θ0 = 0. That is Yt = et + · · · + e1 . By similar calculation,
we know that {Yt } is not stationary. However, the first differences of {Yt },
defined by Wt = Yt − Yt−1 = et , is stationary since {et } is a white noise
process.

13

You might also like