View source: R/cov.structure.R
cov.structure | R Documentation |
This function computes the empirical cross-covariance of two stationary multivariate time series. If only one time series is provided it determines the empirical autocovariance function.
cov.structure(X, Y = X, lags = 0)
X |
vector or matrix. If matrix, then each row corresponds to a timepoint of a vector time series. |
Y |
vector or matrix. If matrix, then each row corresponds to a timepoint of a vector time series. |
lags |
an integer-valued vector (\ell_1,…, \ell_K) containing the lags for which covariances are calculated. |
Let [X_1,…, X_T]^\prime be a T\times d_1 matrix and [Y_1,…, Y_T]^\prime be a T\times d_2 matrix. We stack the vectors and assume that (X_t^\prime,Y_t^\prime)^\prime is a stationary multivariate time series of dimension d_1+d_2. This function determines empirical lagged covariances between the series (X_t) and (Y_t). More precisely it determines \widehat{C}^{XY}(h) for h\in lags, where \widehat{C}^{XY}(h) is the empirical version of \mathrm{Cov}(X_h,Y_0). For a sample of size T we set \hatμ^X=\frac{1}{T}∑_{t=1}^T X_t and \hatμ^Y=\frac{1}{T}∑_{t=1}^T Y_t and
\hat C^{XY}(h) = \frac{1}{T}∑_{t=1}^{T-h} (X_{t+h} - \hatμ^X)(Y_{t} - \hatμ^Y)'
and for h < 0
\hat C^{XY}(h) = \frac{1}{T}∑_{t=|h|+1}^{T} (X_{t+h} - \hatμ^X)(Y_{t} - \hatμ^Y)'.
An object of class timedom
. The list contains
operators
\quad an array. Element [,,k]
contains the covariance matrix related to lag \ell_k.
lags
\quad returns the lags vector from the arguments.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.