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) array
Input
-
On entry: the values of the series.
-
2:
– Real (Kind=nag_wp) array
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:
– 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) array
Output
-
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:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or 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.
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 routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.