Computes the sample cross-correlation function of two stationary time series.
For a list of all members of this type, see CrossCorrelation Members.
System.Object
Imsl.Stat.CrossCorrelation
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
CrossCorrelation estimates the cross-correlation function of two jointly stationary time series given a sample of n = x.Length observations
and
for t = 1,2, ..., n.
Let
The autocovariance function of
,
, is estimated by
maximumLag. Note that x returned by property VarianceX. The autocorrelation function Note that
by definition. Let
The cross-covariance function
is estimated by

The standard errors of the sample cross-correlations may be optionally computed according to the GetStandardErrors method argument stderrMethod. One method is based on a general asymptotic expression for the variance of the sample cross-correlation coefficient of two jointly stationary time series with independent, identically distributed normal errors given by Bartlet (1978, page 352). The theoretical formula is
![\begin{array}{c}
{\rm var} \left \{ \hat \rho _{XY}(k) \right \} =
\frac{1}{n-k}\sum\limits_{i=-\infty}^{\infty}
\left [\right. {\rho _X(i)}+\rho _{XY}(i-k)\rho _{XY}(i+k) \\
-2\rho _{XY}(k)\{\rho _X(i)\rho _{XY}(i+k)+\rho _{XY}(-i)\rho _Y(i+k)\} \\
+\rho^2_{XY}(k)\{\rho_X(i) + \frac{1}{2}\rho^2_X(i) +
\frac{1}{2}\rho^2_Y(i)\} \left. \right ] \end{array}](eqn/eqn_2214.png)
A second method evaluates Bartlett's formula under the additional assumption that the two series have no cross-correlation. The theoretical formula is
An important property of the cross-covariance coefficient is
for
. This result is used in the computation of the standard error of the sample cross-correlation for lag
. In general, the cross-covariance function is not symmetric about zero so both positive and negative lags are of interest.
Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll)
CrossCorrelation Members | Imsl.Stat Namespace | Example