– Spectral Analysis of ST414 Time Series Data Lecture 2

advertisement
ST414 – Spectral Analysis of
Time Series Data
Lecture 2
30 January 2014
Last Time
• Weak stationarity
• The autocovariance function
• MA & AR models
2
Today’s Objectives
• Introduce the periodogram
• Introduce the spectral density function
• Derive the spectral density function for
time domain models
3
Recall
where
π‘ž
πœŽπ‘˜2 cos(2πœ‹πœ”π‘˜ β„Ž)
𝛾 β„Ž =
π‘˜=1
4
Recall
5
Shumway & Stoffer, 2004
Two Problems
1. What is the amplitude for the oscillations?
2. How do you pick the frequencies that
drive the data?
6
Example
7
Problem 1
Regress the data on the sines and cosines
that oscillate at the frequency of interest.
8
Problem 1
True values: 𝛽1 = 2 cos πœ™ = −.62,
𝛽2 = −2 sin πœ™ = −1.90
9
,
Problem 1
10
Problem 2
Regress sine and cosine waves oscillating
at each frequency.
11
Problem 2
From the first part:
2πœ‹π‘‘
𝑑 cos(
) 2
50 =
𝛽1 =
2πœ‹π‘‘
𝑇
𝑇
2
π‘π‘œπ‘ 
(
)
𝑑=1
50
2πœ‹π‘‘
𝑇
2
𝑑=1 𝑋 𝑑 sin( 50 )
𝛽2 =
=
2πœ‹π‘‘
𝑇
𝑇
2
𝑠𝑖𝑛
(
)
𝑑=1
50
𝑇
𝑑=1 𝑋
𝑇
2πœ‹π‘‘
𝑋 𝑑 cos(
)
50
𝑑=1
𝑇
2πœ‹π‘‘
𝑋 𝑑 𝑠𝑖𝑛(
)
50
𝑑=1
12
Problem 2
Consider instead
𝑇
𝑗
2
𝑗
𝛽1
=
𝑋 𝑑 cos(2πœ‹π‘‘ )
𝑇
𝑇
𝑇
𝑑=1
𝑇
𝑗
2
𝑗
𝛽2
=
𝑋 𝑑 𝑠𝑖𝑛(2πœ‹π‘‘ )
𝑇
𝑇
𝑇
𝑑=1
From here, look at the “squared correlations”:
2
2
𝑗
𝑗
𝛽1
+ 𝛽2
𝑛
𝑛
13
Problem 2
14
The Periodogram
The Discrete Fourier transform:
𝑗
𝑑
= 𝑇 −1/2
𝑇
𝑇
=𝑇
−1/2
𝑑=1
𝑇
𝑑=1
𝑗
𝑋 𝑑 exp −2πœ‹π‘–π‘‘
𝑇
𝑗
𝑋 𝑑 cos 2πœ‹π‘‘
𝑇
𝑇
−𝑖
𝑑=1
𝑗
𝑋 𝑑 sin 2πœ‹π‘‘
𝑇
15
The Periodogram
𝑗
𝑑
𝑇
2
1
=
𝑇
𝑇
𝑑=1
Recall:
𝑗
2
𝛽1
=
𝑇
𝑇
𝑗
2
𝛽2
=
𝑇
𝑇
2
𝑗
𝑋 𝑑 cos 2πœ‹π‘‘
𝑇
1
+
𝑇
𝑇
𝑑=1
2
𝑗
𝑋 𝑑 sin 2πœ‹π‘‘
𝑇
𝑇
𝑗
𝑋 𝑑 cos(2πœ‹π‘‘ )
𝑇
𝑑=1
𝑇
𝑗
𝑋 𝑑 𝑠𝑖𝑛(2πœ‹π‘‘ )
𝑇
𝑑=1
16
The Periodogram
The periodogram can be easily (and
quickly!) computed using the Fast Fourier
transform.
17
The Periodogram
18
Shumway & Stoffer, 2004
The Periodogram
19
Example
20
Example
21
The Spectral Density
The periodogram is an estimator for a
population-level statistic called the spectral
density function.
22
The Spectral Density
Let
β„Žπœ–π’ |𝛾
β„Ž | < ∞. Then
𝑓 πœ” =
𝛾 β„Ž exp(−𝑖2πœ‹πœ”β„Ž)
β„Žπœ–π’
is called the spectral density function.
Moreover,
1/2
𝛾 β„Ž =
exp 𝑖2πœ‹πœ”β„Ž 𝑓 πœ” π‘‘πœ”
−1/2
23
The Spectral Density
𝛾 β„Ž and 𝑓 πœ” are Fourier transform pairs:
If 𝛾𝑓 β„Ž =
0.5
exp(𝑖2πœ‹πœ”β„Ž)𝑓
−0.5
0.5
exp(𝑖2πœ‹πœ”β„Ž)𝑔
−0.5
πœ” π‘‘πœ” =
πœ” π‘‘πœ” = 𝛾𝑔 β„Ž , then
𝑓 πœ” =𝑔 πœ” .
24
The Spectral Density
1. 𝑓 πœ” ≥ 0
2. 𝑓 πœ” = 𝑓(−πœ”)
3. 𝑓 πœ” = 𝑓(1 − πœ”)
25
White Noise
Let X(t) be white noise with variance 𝜎 2 .
What is 𝛾 β„Ž ?
𝜎 2 if β„Ž = 0
𝛾 β„Ž =
0 if β„Ž > 0
What is 𝑓 πœ” ?
𝑓 πœ” = 𝜎2
26
MA(1)
𝑋 𝑑 = 𝑍 𝑑 + πœƒπ‘(𝑑 − 1)
𝑍 𝑑 is white noise (0, 𝜎 2 )
𝜎 2 1 + πœƒ 2 if β„Ž = 0
𝛾 β„Ž =
𝜎 2 πœƒ if |β„Ž| = 1
0 if β„Ž > 1
2
2
𝑓 πœ” = 𝜎 πœƒ + 2πœƒ cos 2πœ‹πœ” + 1
27
MA(1)
28
AR(1)
𝑋 𝑑 = πœ™π‘‹ 𝑑 − 1 + 𝑍 𝑑
𝑍 𝑑 is white noise (0, 𝜎 2 )
𝜎 2πœ™β„Ž
γ β„Ž =
1 − πœ™2
𝜎2
𝑓 πœ” = 2
πœ™ − 2πœ™ cos 2πœ‹πœ” + 1
29
AR(1)
30
AR(1)
31
AR(1)
32
AR(1)
33
AR(1)
34
AR(1)
35
The Periodogram
Recall the DFTs:
𝑇
𝑑 πœ”π‘— = 𝑇 −1/2
𝑋 𝑑 exp −2πœ‹π‘–πœ”π‘— 𝑑
𝑑=1
Their asymptotic distribution (under general
conditions) is complex Gaussian with mean
0 and variance 𝑓 πœ” .
36
The Periodogram
The asymptotic distribution of the
periodogram 𝐼(πœ”) is
2𝐼 πœ”
𝑓 πœ”
𝑑
πœ’ 2 (2)
37
Download