Page 1

arXiv:1009.2698v2 [stat.CO] 24 Jan 2011

Approximate variances for tapered

spectral estimates

Michael Amrein and Hans R. K¨ unsch

Seminar f¨ ur Statistik

ETH Zentrum

CH-8092 Z¨ urich, Switzerland

January 2011

Abstract

We propose an approximation of the asymptotic variance that

removes a certain discontinuity in the usual formula for the raw and

the smoothed periodogram in case a data taper is used. It is based

on an approximation of the covariance of the (tapered) periodogram

at two arbitrary frequencies. Exact computations of the variances

for a Gaussian white noise and an AR(4) process show that the

approximation is more accurate than the usual formula.

Key words: Asymptotic variance, data taper, (smoothed) pe-

riodogram.

1 Introduction

Spectral estimation is by now a standard topic in time series analysis, and many

excellent books are available, e.g. Percival and Walden (1993) or Bloomfield

(2000). The purpose of this short note is to propose an approximation of the

asymptotic variance that removes a certain discontinuity in the usual formula

for the raw and the smoothed periodogram in case a taper is used. The standard

asymptotic variance of the raw periodogram is independent of the taper chosen,

see Formulae (222b) and (223c) in Percival and Walden (1993). However, this

changes when the raw periodogram is smoothed over frequencies close by. Then

a variance inflation factor Ch, see (4), appears which is equal to one if no taper is

used and greater than one otherwise, compare Table 248 in Percival and Walden

(1993). The reason for this is that tapering introduces correlations between the

raw periodogram at different Fourier frequencies. Because of this, the variance

reduction due to smoothing is smaller in the case of no tapering. The above

variance inflation factor is justified asymptotically when the number of Fourier

frequencies that are involved in the smoothing tends to infinity (more slowly

than the number of observations, otherwise we would have a bias). Hence,

1

Page 2

if only little smoothing is used, then we expect something in between: some

increase in the variance, but less than the asymptotic variance inflation factor

Ch. We give here a formula, see (5), which is almost as simple as the inflation

factor, but which takes the amount of smoothing into account.

2Notation and preliminaries

Let {Xt}t∈Z be a real-valued stationary process with observation frequency

1/∆, mean E[Xt] = µ, autocovariances sτ:= Cov(Xt,Xt+τ) and spectral den-

sity S(f). We assume that X1,X2,...,XN have been observed. The tapered

periodogram (called direct spectral estimator in Percival and Walden (1993))

is

∆

?N

for f ∈ [0,1/(2∆)]. Here the estimator ˜ µ is usually either the arithmetic mean

¯ X or the weighted average (?N

either version. The taper (h1,...,hN) is chosen to reduce the discontinuities of

the observation window at the edges t = 1 and t = N. Usually, it has the form

ht= h((2t − 1)/(2N)) with a function h that is independent of the sample size

N. A popular choice is the split cosine taper

ˆS(tp)(f) :=

t=1h2

t

?????

N

?

t=1

ht(Xt− ˜ µ)e−i2πitf∆

?????

2

t=1htXt)/(?N

t=1ht). The latter has the property

thatˆS(tp)(0) = 0. Since the choice is irrelevant for the asymptotics, we can use

hp(x) =

1

2(1 − cos(2πx/p))

1

1

2(1 − cos(2π(1 − x)/p))

0 ≤ x ≤p

p

2< x < 1 −p

1 −p

2≤ x ≤ 1

2

2

. (1)

The tapered periodogram has the approximate variance

Var[ˆS(tp)(f)] ≈ S(f)2, f / ∈ {0,1/(2∆)}

(2)

(see e.g. Percival and Walden (1993), Formula (222b)). In particular, it does

not converge to zero. Because of this, one usually smoothes the periodogram

over a small band of neighboring frequencies. We smooth discretely over an

equidistant grid of frequencies. Let fN′,k= k/(N′∆) (0 ≤ k ≤ N′/2) for an

integer N′of order O(N). Then the tapered and smoothed spectral estimate is

ˆS(ts)(fN′,k) =

M

?

j=−M

gjˆS(tp)(fN′,k−j),

where the gj’s are weights with the properties gj> 0, gj= g−j(−M ≤ j ≤ M)

and?M

exclude j = k from the sum.

j=−Mgj= 1. If k ≤ M, the smoothing includes the valueˆS(tp)(0) which

is equal or very close to zero if the mean µ is estimated. In this case, we should

2

Page 3

3Approximations of the variance of spectral estima-

tors

The usual approximation for the relative variance ofˆS(ts)(fN′,k) is

Var

?ˆS(ts)(fN′,k)

S(fN′,k)

?

≈ ChN′

N

M

?

r=−M

g2

r

(3)

for k ?= 0,N′/2 where

Ch=

?N

t=1h4

t=1h2

t/N

t/N)2.

(?N

(4)

This formula is given in Bloomfield (2000), equation (9.12) on p. 183, and

it is implemented in the function “spec.pgram” in the language for statistical

computing R (R Development Core Team (2010)). In order to see that it is the

same as Formula (248a) in Percival and Walden (1993), one has to go back to

the definition of Wmin terms of the weights gjwhich is given by the formulae

(237c), (238d) and (238e). If we put M = 0, (3) is different from (2). The reason

for this difference is that (3) is valid in the limit M → ∞ and M/N′→ 0. But

in applications M is often small, e.g. M = 1, and one wonders how good the

approximation is in such a case.

We propose here as alternative the following approximation for the relative

variance

(again for k ?= 0,N′/2) where H(N)

2

(f) =

compute this expression, we need to compute the convolution of the weights

(gj) and the discrete Fourier transform of the squared taper. The former is

usually not a problem since M is substantially smaller than N′. Using the fast

Fourier transform, exact computation of the latter is in most cases also possible.

If not, then by the Lemma below we can use

M

?

r=−M

g2

r+ 2

2M

?

l=1

???H(N)

2

H(N)

2

(fN′,l)

???

2

(0)2

M−l

?

r=−M

grgr+l

(5)

1

N

?N

t=1h2

te−i2πtf∆. In order to

H(N)

2

(f) ≈

?1

0

h2(u)e−i2πNuf∆du e−iπf∆

πf∆

sin(πf∆).

Choosing a simple form for the function h, we can compute the integral on the

right exactly. It is obvious that (5) agrees with (2) for M = 0. In the next

section, we show that it also agrees with (3) for M large.

4Justification of the approximation

The idea is simple: We just plug in a suitable approximation for the relative

covariances of the tapered periodogram values into the exact expression for the

3

Page 4

relative variance. Var

?ˆS(ts)(fN′,k)/S(fN′,k)

M

?

?

is equal to

M

?

r=−M

s=−M

grgsCov

?ˆS(tp)(fN′,k−r)

S(fN′,k−r)

,

ˆS(tp)(fN′,k−s)

S(fN′,k−s)

?

. (6)

The asymptotic behavior of these covariances is well known. Theorem 5.2.8 of

Brillinger (1975) shows that, under suitable conditions, we have for frequencies

0 < f ≤ g < 1/(2∆) that

Cov

?ˆS(tp)(f)

S(f)

,

ˆS(tp)(g)

S(g)

?

=

???H(N)

2

(f − g)

???

2

+

???H(N)

(0)

2

(f + g)

???

2

???H(N)

2

???

2

+ O(N−1). (7)

The statement in Brillinger (1975) is actually asymmetric in f and g since it

has S(f) instead of S(g) on the left side in the equation above. Our statement

can be proved by the same argument if we assume S(f) ≈ S(g) when |f −g| is

small. When |f − g| is big, i.e. not of order O(N−1), the covariance is of the

order O(N−1) anyhow. Using the approximation (7) directly would lead to an

approximation which depends on k. Having to compute N′/2 different approx-

imate variances is usually too complicated. However, the term |H(N)

small unless ∆(f +g) is close to zero modulo one. This has been pointed out by

Thomson (1977), see also the discussion on p. 230–231 of Percival and Walden

(1993). If we omit this term, then we obtain our new approximation (5) by a

simple change in the summation indices.

2

(f +g)|2is

We next give a simple lemma that justifies the omission of the second term in

(7). In addition, it also shows how the usual approximation (3) follows from

(5).

Lemma 4.1. If ψ is once continuously differentiable on [0,1] and ψ′is Lipschitz

continuous with constant L, then

1

N

N

?

t=1

ψ

?2t − 1

2N

?

e−i2πλt=

?1

0

ψ(u)e−i2πNλudu e−iπλ

πλ

sin(πλ)+ R

where |R| ≤ const./N uniformly for all λ ∈ [0,0.5].

Proof. Put ǫ = 1/(2N). By a Taylor expansion, we obtain for any x ∈ [0,1]

?x+ǫ

x−ǫ

ψ(u)e−i2πNλudu = ψ(x)e−i2πNλx

?ǫ

?ǫ

−ǫ

e−i2πNλudu

+ ψ′(x)e−i2πNλx

−ǫ

ue−i2πNλudu + R′

where the remainder satisfies |R′| ≤ 2ǫ3L/3 = L/(12N3). Next, observe that

?ǫ

From this the lemma follows by taking x = (2t − 1)/(2N) for t = 1,...,N and

summing up all terms.

−ǫ

e−i2πNλudu =sin(πλ)

πλN

,

?ǫ

−ǫ

ue−i2πNλudu =

i

2πλN2

?

cos(πλ) −sin(πλ)

πλ

?

.

4

Page 5

If ψ(0) = ψ(1) = 0, then by partial integration

????

?1

0

ψ(u)e−i2πNλudu

????≤sup|ψ′(x)|

2πλN

.

Hence by setting ψ(u) = h2(u), we obtain

H(N)

2

(f) ≤ const.(Nf∆)−1+ const.N−1≤ const.(Nf∆)−1

(8)

for f ≤ 1/∆. Therefore the second term in (7) is negligible unless f + g is of

the order O(N−1).

Finally, we derive the usual variance approximation (3) from (5) as follows. By

Parseval’s theorem

N′/2

?

l=−N′/2

???H(N)

t=1h2

2

(fN′,l)

???

2

=N′

N

1

N

N

?

t=1

h4

t.

Note that H(N)

2

(0) = 1/N ·?N

N′/2

?

t. Because of (8), we have

l=2M+1

???H(N)

2

(fN′,l)

???

2

≤

N′/2

?

l=2M+1

?const. · N′

Nl∆

?2

→ 0

for M → ∞ and N′= O(N) → ∞. Thus

2M

?

l=−2M

???H(N)

2

(fN′,l)

???

2

−N′

N

1

N

N

?

t=1

h4

t→ 0,

also in the above limit. If the weights gj change smoothly as a function g of

the lag j, i.e., gj= g(j/M), then for any fixed l

M−l

?

r=−M

grgr+l∼ M

?1

−1

g2(u)du ∼

M

?

r=−M

g2

r(M → ∞)

and the desired result follows by dominated convergence.

5Comparison with exact relative variances for Gaus-

sian processes

If we assume the process {Xt}t∈Zto be Gaussian, then it holds

Cov

?ˆS(tp)(f)

S(f)

,

ˆS(tp)(g)

S(g)

?

=

1

S(f)S(g)(?N

??????

5

t=1h2

t)2

×

??????

N

?

j,k=1

hjhksj−ke−i2π(fj−gk)∆

2

+

??????

N

?

j,k=1

hjhksj−ke−i2π(fj+gk)∆

??????

2

,

Page 6

see p. 326 of Percival and Walden (1993). Plugging this into (6) yields thus an

exact expression. Evaluation is of the order O(N3), thus it is not practical to

use it routinely.

We now compare the two approximations to the exact relative variances for a

Gaussian white noise Xt= ǫtand the AR(4) process

Xt= 2.7607Xt−1− 3.8106Xt−2+ 2.6535Xt−3− 0.9238Xt−4+ ǫt

(9)

used in Percival and Walden (1993) (see p.

True spectra are shown in Figure 1 in decibel (dB), i.e., the plot displays

10log10(S(.)). As we can see, the spectrum of the AR(4) process varies over a

46) where ǫt i.i.d ∼ N(0,1).

Figure 1: Spectra of the Gaussian white noise and the AR(4) process in (9) in

dB.

wide range and exhibits two sharp peaks. Further, we assume the observation

frequency 1/∆ to be 1 and N = 210= 1024. We compute the exact rela-

tive variance (6) at the frequencies fk,N′, k = 0,...,N′/2, for N′∈ {N,2N},

the split cosine taper (1) with p ∈ {0.2,0.5} and weights gj = 1/(2M + 1),

j = −M,...,M, with M ∈ {0,1,2}. Comparison to the usual approximation

(3) and to the new one (5) is shown in Figure 2. The code in R is available un-

der http : //stat.ethz.ch/ ∼ kuensch/papers/approximate variances.R.

We see that the new approximation fits the true relative variances clearly bet-

ter when we smooth over few frequencies, i.e., M is small. Especially in the

situations when the data is strongly tapered (p = 0.5) or when we use a refined

smoothing grid (N′= 2N) we recommend to use the new approximation (5).

Acknowledgement

We thank Don Percival and Martin M¨ achler for helpful comments and sugges-

tions on earlier versions.

References

Bloomfield, P. (2000). Fourier Analysis of Time Series: An Introduction. Wiley,

NY, 2nd edition.

6

Page 7

Brillinger, D. R. (1975). Time Series, Data Analysis and Theory. International

Series in Decision Processes. Holt, Rinehart and Winston, Inc., New York.

Percival, D. B. and Walden, A. T. (1993). Spectral Analysis for Physical Ap-

plications: Multitaper and Conventional Univariate Techniques. Cambridge

University Press.

R Development Core Team (2010). R: A Language and Environment for Statis-

tical Computing. R Foundation for Statistical Computing, Vienna, Austria.

Thomson, D. J. (1977). Spectrum estimation techniques for characterization

and development of WT4 waveguide - I. Bell System Technical Journal,

56:1769–1815.

7

Page 8

Figure 2: Exact relative variances of the Gaussian white noise (thick-

dashed) and the AR(4) process (thick-solid) in comparison to the usual

(thin-dashed) and the new (thin-solid) approximation for different choices

of N′, p and M.

8