spectral.density {freqdom}R Documentation

Compute empirical spectral density

Description

Estimates the spectral density and cross spectral density of vector time series.

Usage

spectral.density(
  X,
  Y = X,
  freq = (-1000:1000/1000) * pi,
  q = max(1, floor(dim(X)[1]^(1/3))),
  weights = c("Bartlett", "trunc", "Tukey", "Parzen", "Bohman", "Daniell",
    "ParzenCogburnDavis")
)

Arguments

X

a vector or a vector time series given in matrix form. Each row corresponds to a timepoint.

Y

a vector or vector time series given in matrix form. Each row corresponds to a timepoint.

freq

a vector containing frequencies in [π,π][-\pi, \pi] on which the spectral density should be evaluated.

q

window size for the kernel estimator, i.e. a positive integer.

weights

kernel used in the spectral smoothing. By default the Bartlett kernel is chosen.

Details

Let [X1,,XT][X_1,\ldots, X_T]^\prime be a T×d1T\times d_1 matrix and [Y1,,YT][Y_1,\ldots, Y_T]^\prime be a T×d2T\times d_2 matrix. We stack the vectors and assume that (Xt,Yt)(X_t^\prime,Y_t^\prime)^\prime is a stationary multivariate time series of dimension d1+d2d_1+d_2. The cross-spectral density between the two time series (Xt)(X_t) and (Yt)(Y_t) is defined as

hZCov(Xh,Y0)eihω. \sum_{h\in\mathbf{Z}} \mathrm{Cov}(X_h,Y_0) e^{-ih\omega}.

The function spectral.density determines the empirical cross-spectral density between the two time series (Xt)(X_t) and (Yt)(Y_t). The estimator is of form

F^XY(ω)=hqw(k/q)C^XY(h)eihω, \widehat{\mathcal{F}}^{XY}(\omega)=\sum_{|h|\leq q} w(|k|/q)\widehat{C}^{XY}(h)e^{-ih\omega},

with C^XY(h)\widehat{C}^{XY}(h) defined in cov.structure Here ww is a kernel of the specified type and qq is the window size. By default the Bartlett kernel w(x)=1xw(x)=1-|x| is used.

See, e.g., Chapter 10 and 11 in Brockwell and Davis (1991) for details.

Value

Returns an object of class freqdom. The list is containing the following components:

References

Peter J. Brockwell and Richard A. Davis Time Series: Theory and Methods Springer Series in Statistics, 2009


[Package freqdom version 2.0.5 Index]