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.
spectral.density(X, Y = NULL, V = NULL, freq = NULL, q = NULL,
weights = NULL)
first process
second process, if NULL
then spectral density of X is computed
correlation structure between coefficients of vectors (default diagonal)
evaluation grid - vector of values between [-pi,pi]
size of the window (covariances from -q to q will be computed)
kernel used to decay significance of covariances with higher lags ('Bartlett', 'trunc', 'Tukey', 'Parzen', 'Bohman', 'Daniell', 'ParzenCogburnDavis').
Frequency Domain Operator object
Peter J. Brockwell and Richard A. Davis Time Series: Theory and Methods Springer Series in Statistics, 2009
# NOT RUN {
X = rar(100)
Y = rar(100)
spectral.density(X,Y)
# }
Run the code above in your browser using DataLab