Given two series
and
the function calculates the cross-correlations between
and lagged values of
:
where
and similarly for
.
The ratio of standard deviations
is also returned, and a portmanteau statistic is calculated:
Provided
is large,
much less than
, and both
are samples of series whose true autocorrelation functions are zero, then, under the null hypothesis that the true cross-correlations between the series are zero,
stat has a
-distribution with
degrees of freedom. Values of
stat in the upper tail of this distribution provide evidence against the null hypothesis.
-
1:
– const double
Input
-
On entry: the values of the series.
-
2:
– const double
Input
-
On entry: the values of the series.
-
3:
– Integer
Input
-
On entry: , the length of the time series.
Constraint:
.
-
4:
– Integer
Input
-
On entry: , the maximum lag for calculating cross-correlations.
Constraint:
.
-
5:
– double *
Output
-
On exit: the ratio of the standard deviation of the series to the standard deviation of the series, .
-
6:
– double *
Output
-
On exit: the cross-correlation between the and series at lag zero.
-
7:
– double
Output
-
On exit: contains the cross-correlations between the and series at lags , , for .
-
8:
– double *
Output
-
On exit: the statistic for testing for absence of cross-correlation.
-
9:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
All computations are believed to be stable.
Background information to multithreading can be found in the
Multithreading documentation.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.