Learn R Programming

freqdom (version 1.0.4)

spectral.density: Compute the cross spectral density of processes X and Y

Description

Computes the spectral density of processes \(X_t\) and \(Y_t\) using a Bartlett style estimator, i.e. $$ \hat F_\theta^{XY} = \sum_{k=-q}^q W(|k|/q) \hat C_{XY}^k e^{-i\theta k},$$ where \(\theta \in [-\pi,\pi]\) and \(\hat C_{XY}^k\) is the estimated covariance with lag \(k\). Quality of the estimation depends on choise of the window size \(q\) and \(W\) (weights). For details on spectral density estimation please refer to "Time Series: Theory and Methods" by Peter J. Brockwell and Richard A. Davis. Note that estimator is calculated on the finite grid thetas so #' in some cases numerical quality can be improved by choosing a more dense set.

Usage

spectral.density(X, Y = NULL, V = NULL, freq = NULL, q = NULL,
  weights = NULL)

Arguments

X

first process

Y

second process, if NULL then spectral density of X is computed

V

correlation structure between coefficients of vectors (default diagonal)

freq

evaluation grid - vector of values between [-pi,pi]

q

size of the window (covariances from -q to q will be computed)

weights

kernel used to decay significance of covariances with higher lags ('Bartlett', 'trunc', 'Tukey', 'Parzen', 'Bohman', 'Daniell', 'ParzenCogburnDavis').

Value

Frequency Domain Operator object

References

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

Examples

Run this code
# NOT RUN {
X = rar(100)
Y = rar(100)
spectral.density(X,Y)
# }

Run the code above in your browser using DataLab