Spectral 95
Spectral 95
Jesus Fernandez-Villaverde
University of Pennsylvania
1
Why Spectral Analysis?
2
Riesz-Fisher Theorem
Inversion formula:
Z
1
ck = f (! ) ei!k d!
2
4
Harmonics
n oj=1
The functions e i!j are called harmonics and constitute an
j= 1
orthonormal base in L2 [ ; ].
if j 6= k and
Z
e i!j ei!j d! = 1
The fact that they constitute a base is given by the second theorem
that goes in the opposite direction than Riesz-Fischer: given any func-
tion in L2 [ ; ] we can nd an associated sequence in l2 ( 1; 1).
5
Converse Riesz-Fischer Theorem
6
Remarks I
.
The Riesz-Fisher theorem and its converse assure then that the Fourier
transform is an bijective from l2 ( 1; 1) into L2 [ ; ].
7
Remarks II
.
There is a limit in the amount of information in a series.
8
Stochastic Process
1. = Rm 1 limT !1 T Rm
t=0
3. P T (B ) P (B ) j=T P Y T 2 B , 8B 2 =T .
0
De ne a T segment as XT X1; :::; XT with X 0
0 0 = f;g and a
0
realization of that segment as xT x01; :::; x0T .
9
Moments
11
Spectrum
That does not mean having two representations of the same informa-
tion is useless: some characteristics of the series, as its serial correla-
tion are easier to grasp with the autocovariances while others as its
unobserved components (as the di erent uctuations that compose
the series) are much easier to understand in the spectrum.
12
Example
13
Working on the Spectrum
Since j = j: .
0 1
1
X 1
X h i
1 i!j 1 @ i!j i!j A
sx (! ) = je = 0+ j e +e
2 j= 1 2 j=1
0 1
1
X
1 @ A
= 0+2 j cos (!j )
2 j=1
iz iz
by Euler's Formula ( e +e2 = cos z )
Hence:
1. The spectrum is always real-valued.
2. It is the sum of an in nite number of cosines.
3. Since cos (! ) = cos ( ! ) = cos (! + 2 k), k = 0; 1; 2; :::, the
spectrum is symmetric around 0 and all the relevant information is
concentrated in the interval [0; ].
14
Spectral Density Function
.
Sometimes the autocovariance generating function is replaced by the
autocorrelation generating function (where every term is divide by 0).
15
Properties of Periodic Functions
.
Take the modi ed cosine function:
yj = A cos (!j )
.
! = 0, the period of uctuation is in nite, i.e. the frequency associ-
ated with a trend (stochastic or deterministic).
19
Relating Two Time Series
yt = B (L) xt + "t
where
1
X
B (L) = bj Lj
j= 1
and Ext"t = 0 for all j .
20
Thus:
0 10 1
1
X 1
X
ytyt j = @ bs x t s A @ b r xt j r A
s= 1 r= 1
0 1 0 1
1
X 1
X
+@ b s xt s A "t j + @ br xt j r A "t + "t"t j
s= 1 r= 1
22
LTI Filters
yt = B (L) xt
2 2
B e i! is the power transfer function (since B e i! is a
quadratic form, it is a real function). It indicates how much the spec-
trum of the series is changed at each particular frequency.
23
Gain and Phase
The de nition of gain implies that the ltered series has zero variance
P i0 = P1
at ! = 0 if and only if B e i0 .= 1 j= 1 jb e j= 1 bj = 0.
B e i! = B a (! ) + iB b (! )
24
Symmetric Filters I
A lter is symmetric if bj = b j :
.
1
X
B (L) = b0 + bj Lj + L j
j=1
25
Symmetric Filters II
P1
If j= 1 bj = 0, symmetric lters can remove trend frequency compo-
nents, either deterministic or stochastic up to second order (a quadratic
deterministic trend or a double unit root):
.
1
X 1
X 1
X
bj Lj = bj Lj +L j 2 bj Lj
j= 1 j=1 j= 1
X1 1
X
= bj Lj + L j 2 = bj 1 Lj 1 L j
j=1 j=1
1
X jX1
= (1 L) 1 L 1 bj (k jhj) Lh
j=1 h= j+1
= (1 L) 1 L 1 B 0 (L)
1
X jX1
(1 + L + :::) 1 + L 1 + ::: = bj (k jhj) Lh
j=1 h= j+1
if the sum is well de ned.
26
Ideal Filters
An ideal lter is an operator B (L) such that the new process Y only
.
has positive spectrum in some speci ed part of the domain.
27
How Do We Build an Ideal Filter?
P1 2
Since X is a zero mean, covariance stationary process, n= 1 jxn j <
.
1, the Riesz-Fischer Theorem holds.
28
Building an Ideal Filter
Also:
Z
1 b b a
b0 = 2 cos ! 0d! =
2 a
and we have all the coe cients to write:
0 1
1
X
b a sin jb sin ja
yt = @ + Lj + L j A xt
j=1 j
Just set a = 0.
sin jb
bj = b j = 8 j 2 N n f0g
j
b
b0 =
0 1
1
X
b sin jb j
yt = @ + L + L j A xt
j=1 j
30
Building an High-Pass Filter
31
Finite Sample Approximations
With real, nite, data, it is not possible to apply any of the previous
formulae since they require an in. nite amount of observations.
33
Minimization Problem
How? Solve:
T
X TX1 h i2
t 2
min xt xt + xtt+1 xtt xtt xtt 1
xtt t=1 t=2
Intuition.
Meaning of :
2. = 1 )linear trend.
34
Matrix Notation
35
Solution
xt x + A0Axt = 0
or
1
xt = I + A 0 A x
36
Properties I
37
Properties II
Remember that:
2 2
sxc (! ) = 1 B e i! sx (! ) = C e i! sx (! )
.
We can evaluate at e i! and taking the module, the gain of the cyclical
component is:
2 2
1 e i! 1 ei!
Gc (! ) = 2 2
1+ 1 e i! 1 ei!
4 (1 cos (! ))2
=
1 + 4 (1 cos (! ))2
where we use the identity 1 e i! 1 ei! = 2 (1 cos (! )).
This function gives zero weight to zero frequencies and close to unity
on high frequency, with increases in moving the curve to the left.
Finally note that since the gain is real, (! ) = 0 and the series is not
translated in time.
39
Butterworth Filters
Higher values of d make the slope of the band more vertical while
smaller values of ! 0 narrow the width of the lter band.
40
Butterworth Filters and the HP Filter
41
Ideal Filter Revisited
P1 jx
Recall that in our discussion about the ideal lter yt = j= 1 b j L t
we derived the formulae:
sin jb sin ja
bj = b j = 8j2N
j
b
b0 =
0 = 2 bj bfj +
Pk
j= k bj
= 2
2k + 1
for j = 1; :::; k, that provides the desired result.
Notice that, since the ideal lter is a step function, this approach
su ers from the same Gibbs phenomenon that arises in Fourier analysis
(Koopmans, 1974).
45