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