Docsity

Frequency Domain Analysis - Time Series Analysis - Lecture Notes, Study notes of Mathematical Statistics

Partial preview of the text

Download Frequency Domain Analysis - Time Series Analysis - Lecture Notes and more Study notes Mathematical Statistics in PDF only on Docsity!

STATISTICS 479/503 PART III

TIME SERIES ANALYSIS

Doug Wiens April 12, 2005

Contents

Part III

Frequency Domain

Analysis

  1. Lecture 15

Recall from the first assignment that the function

ρ(m) = cos(2πνm) (− 1 / 2 < ν < 1 /2)

is the ACF of the stationary process

Xt = A cos(2πνt) + B sin(2πνt),

where A and B are independent r.v.s with means = 0 and equal variances. We will see that any zero-mean, weakly stationary process can be obtained through generalizing this example. Essentially we will “mix” examples of this type by assuming that ν is itself a r.v., and taking an expectation over it.

  • See Figures 3.1, 3.2. Sunspot data - the peri- odic behaviour seen in the plot of the series is highlighted in the periodic nature of its sample ACF.
  • Facts from Fourier analysis.

— Given any set x 1 , ..., xT of real numbers, we can write (i.e. solve for {ak , bk)})

xt =

X^ N k=

{ak cos(2πνk t) + bk sin(2πνk t)} ,

where the “amplitudes” ak , bk are appropri- ately chosen coefficients, N = [T /2] (integer part) and νk = k/T (thus 0 ≤ νk ≤ 1 /2).

— The νk are called “frequencies”: cos(2πνk t) and sin(2πνk t) are periodic, with frequency νk and “period” 1/νk. (Think of a plot of sin(2πνk t) - it repeats every 1/νk units, hence νk times per time period.) We say the fre- quency is νk “cycles per unit time”; the period 1 /νk is the time required to complete one cy- cle.

— We often write λk = 2πνk ∈ [0, π]; the “Fourier frequency” λk is measured in “radians per unit time”.

  • More generally, we can consider random variables {Xt}∞ t=−∞ defined by

Xt =

X^ N k=

{Ak cos(λk t) + Bk sin(λk t)}

for Fourier frequencies λk, where A 0 , ..., AN , B 0 , ..., BN are uncorrelated r.v.s with E[Ak] = E[Bk] = 0, V AR[Ak] = V AR[Bk] = σ k^2. Theorem: Any zero-mean, weakly stationary time series may be approximated arbitrarily closely, in this manner.

  • We won’t attempt to prove the theorem, but will verify that such a series {Xt} is weakly stationary. Clearly the mean is 0. We will show that the autocovariance function is

γ(m) =

X^ N k=

σ^2 k cos(λk m).

  • To generalize this further, write the variance of Xt as σ^2 = γ(0) = PNk=0 σ k^2 , so that the auto- correlation is

ρ(m) = γ(m) γ(0)

X^ N k=

σ k^2 σ^2

cos(λk m)

σ 02 σ^2

cos(λ 0 m)

X^ N k=

σ k^2 2 σ^2

cos(λk m) +

X^ N k=

σ k^2 2 σ^2

cos(−λk m).

We aim to write this as

ρ(m) = E [cos(Λm)] =

X^ N k=−N

pk cos (λk m)

for some r.v. Λ. For this, define

λ−k = −λk , σ −^2 k = σ^2 k ,

p−k = pk =

⎧ ⎪⎨ ⎪⎩

σ 02 σ^2 ,^ k^ = 0, σ k^2 2 σ^2 ,^ k^6 = 0.

Then

ρ(m) = p 0 cos(λ 0 m)

X^ N k=

pk cos(λk m) +

X^ −^1 k=−N

pk cos(λk m)

X^ N k=−N

pk cos(λk m), where

X^ N k=−N

pk = 1.

Thus

ρ(m) = E [cos(Λm)] ,

where Λ ∈ [−π, π] is a r.v. with distribution

P (Λ = λk) = pk. Note also

P (Λ = −λk) = p−k = pk = P (Λ = λk).

We say that Λ is symmetrically distributed: it is distributed in the same manner as −Λ.

  1. Lecture 16
  • Review: a zero-mean, weakly stationary series can be approximated as

Xt ≈

X^ N k=

{Ak cos(λk t) + Bk sin(λk t)}

for uncorrelated r.v.s {Ak , Bk} and Fourier fre- quencies λk ∈ [0, π], with the approximation be- coming exact as N → ∞. For a series as on the RHS above, the ACF is

ρ(m) = E [cos(Λm)] for some discrete, symmetric r.v. Λ with possi- ble values λ 0 = 0, ±λ 1 , ..., ±λN. As N → ∞, the distribution of Λ tends to one with a density. Now we write λ = 2πν, − 1 / 2 ≤ ν ≤ 1 /2, and write the density of ν in the form f (ν) /σ^2. The relationship above becomes γ(m) σ^2

= ρ(m) =

Z (^1) / 2 − 1 / 2

cos(2πνm) f (ν) σ^2

dν;

thus

γ(m) =

Z (^1) / 2 − 1 / 2

cos(2πνm)f (ν)dν,

0 =

Z (^1) / 2 − 1 / 2

sin(2πνm)f (ν)dν.

  • For reasons which will become clear, it is sim- pler to view the two integrals above as the real and imaginary parts of a certain complex integral. Put i =

−1, and note (“Euler’s relation”):

eix^ = cos x + i sin x. This is the only feature of complex “analysis” to be used; everything else follows from it; e.g.

— |eix| =

q cos^2 x + sin^2 x = 1

— ei(x+2πk)^ = eix^ ei^2 πk = eix^ (cos 2πk + i sin 2πk) = eix

— eix+e−ix^ = [cos x + i sin x]+[cos (−x) + i sin (−x)] = 2 cos x

— We can interpret f (ν) as a decomposition of the total power, in that f (ν)dν is the portion of the variance attributable to the frequencies near ν. This is akin to Analysis of Variance in classical statistics. A peak in f at ν indicates important contributions to the variance at this frequency. A common application is to alter (“filter”) a series, so as to accentuate certain frequencies and dampen others.

— The power f is uniquely determined by γ. In fact (1) is an integral transform with an “in- verse” :

f (ν) =

X^ ∞ m=−∞

e−^2 πiνm^ γ(m). (2)

We say that f and γ are “Fourier transform pairs”; we shall refer to f as the Infinite Fourier Transform of γ. Note from (2) (and eix^ = ei(x+2πm)^ ) that f (ν) = f (ν +1) = f (ν +2) = ···; f is periodic with period 1. By symmetry, f is completely determined by its behaviour on [0, 1 /2] and so is generally only plotted on this interval.

  • Example: White noise.

f (ν) =

X^ ∞ m=−∞

e−^2 πiνm^ γ(m)

X^ ∞ m=−∞

e−^2 πiνm^

h σ^2 I(m = 0)

i

= σ^2. White noise has a ‘flat spectrum’.

  • Example: Xt = (wt− 1 + wt + wt+1 ) /3, a cen- tred 3-point moving average. Since

γ(m) =

⎧ ⎪⎪⎪ ⎪⎨ ⎪⎪⎪ ⎪⎩

3 σ^2 / 9 , m = 0, 2 σ^2 / 9 , m = ± 1 , σ^2 / 9 , m = ± 2 , 0 , |m| > 2 ,

nu

power

0.00.0 0.1 0.2 0.3 0.4 0.

0.^ 0.^ 0.^ 0.^

Figure 3.3. Power spectrum of 3-point centred moving average. Frequencies above about ν = 1/ 3 are filtered out.

Here is how the power of the 3-point moving average, and “filtering periods > 3” are related.

  • After some algebra, the power is expressible as

fX(ν) =

(1 + 2 cos (2πν))

¾ 2 σ^2 = |A(ν)|^2 σ^2 , for

A(ν) =

(1 + 2 cos (2πν)) =

X^ ∞ t=−∞

at e−^2 πiνt^ and

a 0 = a 1 = a− 1 =

, all others = 0.

  • This illustrates the fact that if Xt = P∞ s=−∞ as^ Zt−s then fX(ν) = |A(ν)|^2 fZ(ν). Here {Zt} = {wt}. More generally, if we apply that same filter {at} to a series {Xt}, to get Yt = P∞ s=−∞ as Xt−s, then we would have fY (ν) = |A(ν)|^2 fX(ν), so periodic trends in {Xt} of period < 3 would be removed in the Yt - series.
  • Reasoning in reverse, if we decided on the shape of A(ν), could we calculate {at} and then do the filtering, to attain a desired aim?