G13BCF calculates cross-correlations between two time series.
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 parameter you should refer to
Section 3.3 in the Essential Introduction 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 parameter, 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.
G13BCF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
G13BCF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
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.