Given two series
and
the routine 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: – Real (Kind=nag_wp) arrayInput
-
On entry: the values of the series.
- 2: – Real (Kind=nag_wp) arrayInput
-
On entry: the values of the series.
- 3: – IntegerInput
-
On entry: , the length of the time series.
Constraint:
.
- 4: – IntegerInput
-
On entry: , the maximum lag for calculating cross-correlations.
Constraint:
.
- 5: – Real (Kind=nag_wp)Output
-
On exit: the ratio of the standard deviation of the series to the standard deviation of the series, .
- 6: – Real (Kind=nag_wp)Output
-
On exit: the cross-correlation between the and series at lag zero.
- 7: – Real (Kind=nag_wp) arrayOutput
-
On exit: contains the cross-correlations between the and series at lags , , for .
- 8: – Real (Kind=nag_wp)Output
-
On exit: the statistic for testing for absence of cross-correlation.
- 9: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
All computations are believed to be stable.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.