Learn R Programming

freqdom (version 1.0.4)

lagged.cov: Compute cross covariance with a given lag

Description

For a given multivariate stationary time series estimates a covarianve matrix \(C_{XY}^k = Cov(X_k,Y_0)\) using the formula $$\hat C_{XY}^k = \frac{1}{n} \sum_{i=1}^{n-k} X_{k+i} Y_k'. $$

Usage

lagged.cov(X, Y = NULL, lag = 0)

Arguments

X

first process

Y

second process, if null then autocovariance of X is computed

lag

the lag that we are interested in

Value

Covariance matrix

Examples

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

Run the code above in your browser using DataLab