Learn R Programming

astsa (version 1.0)

mvspec: Multivariate Spectral Estimation

Description

This is spec.pgram with a few changes in the defaults and written so you can easily extract the estimate of the multivariate spectral matrix as fxx.

Usage

mvspec(x, spans = NULL, kernel = NULL, taper = 0, pad = 0, 
         fast = TRUE, demean = TRUE, detrend = FALSE, 
         plot = FALSE, na.action = na.fail, ...)

Arguments

x
p-variate time series (i.e., the p columns of x are time series)
spans
specify smoothing; same as spec.pgram
kernel
specify kernel; same as spec.pgram
taper
specify taper; same as spec.pgram
pad
specify padding; same as spec.pgram
fast
specify use of FFT; same as spec.pgram
demean
if TRUE, series is demeaned first; same as spec.pgram
detrend
if TRUE, series is detrended first; same as spec.pgram
plot
plot the estimate; same as spec.pgram
na.action
same as spec.pgram
...
additional arguments; same as spec.pgram

Value

  • An object of class "spec", which is a list containing at least the following components:
  • fxxspectral matrix estimates; an array of dimensions dim = c(p,p,nfreq)
  • freqvector of frequencies at which the spectral density is estimated.
  • specvector (for univariate series) or matrix (for multivariate series) of estimates of the spectral density at frequencies corresponding to freq.
  • cohNULL for univariate series. For multivariate time series, a matrix containing the squared coherency between different series. Column i + (j - 1) * (j - 2)/2 of coh contains the squared coherency between columns i and j of x, where i < j.
  • phaseNULL for univariate series. For multivariate time series a matrix containing the cross-spectrum phase between different series. The format is the same as coh.
  • seriesThe name of the time series.
  • snamesFor multivariate input, the names of the component series.
  • methodThe method used to calculate the spectrum.
  • The result is returned invisibly if plot is true.

Details

This is spec.pgram with a few changes in the defaults and written so you can easily extract the estimate of the multivariate spectral matrix as fxx. See Example 7.12 on page 461 for a demonstration.

References

http://www.stat.pitt.edu/stoffer/tsa3/