tseries (version 0.1-1)

cross spectra: Cross Spectra Estimation

Description

Estimates the different types of cross spectra of x and y by smoothing the bivariate periodogram with the kernel k (see Brockwell and Davies (1991), pp. 434-453). If pl is TRUE, then the estimated spectra are plotted. Additionally, the plot contains information about the "equivalent degrees of freedom" df and the bandwidth bw of k (equation (6.10) of T. Thrall (1983)). If k is a Daniell(0) kernel, then the periodogram itself is returned. For absolute.coherency, phase.spectrum, and amplitude.spectrum also the 95%confidence bounds are plotted (see Brockwell and Davies (1991), equations (11.7.8), (11.7.9), and (11.7.11). Note, the error in (11.7.9)). Missing values are not handled.

Usage

cross.spectrum (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10))
co.spectrum (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10), pl = TRUE, ...)
quadrature.spectrum (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10), pl = TRUE, ...)
absolute.coherency (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10), pl = TRUE, ...)
phase.spectrum (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10), pl = TRUE, ...)
amplitude.spectrum (x, y, k = fejer.kernel(length(x)%/%2,length(x)/10), pl = TRUE, ...)

Arguments

x,y
numeric vectors or time series.
k
a smoothing kernel of class "kernel".
pl
a logical indicating whether the estimated spectrum is plotted.
...
additional arguments to plot.tsparam.

Value

  • A "tsparam" object.

References

P. J. Brockwell and R. A. Davis (1991): Time Series: Theory and Methods, 2nd Edition, Springer Verlag, NY, pp. 434-453.

T. Thrall (1983): Computer Programming of spectrum estimation, in D. R. Brillinger and P. R. Krishnaiah (Eds.), Handbook of Statistics 3, Time Series in the Frequency Domain, Elsevier Science, North-Holland, pp. 409-437.

See Also

tsparam, kernel, spectrum

Examples

Run this code
data (sales)  # Reproduce example 11.7.1, Brockwell and Davis (1991)
sal <- diff (sales)
le <- diff (lead)
k <- daniell.kernel (6)
spectrum (le, k)
spectrum (sal, k)
absolute.coherency (le, sal, k, ylim = range(0,1))
phase.spectrum (le, sal, k)

Run the code above in your browser using DataCamp Workspace