The quantities calculated are:
-
(a)The sample mean
-
(b)The sample variance (for )
-
(c)The sample autocorrelation coefficients of lags , where is a user-specified maximum lag, and , .
-
(d)The coefficient of lag is defined as
-
(e)See page 496 et seq. of Box and Jenkins (1976) for further details.
-
(f)A test statistic defined as
which can be used to test the hypothesis that the true autocorrelation function is identically zero.
If
is large and
is much smaller than
,
stat has a
distribution under the hypothesis of a zero autocorrelation function. Values of
stat in the upper tail of the distribution provide evidence against the hypothesis.
Section 8.2.2 of
Box and Jenkins (1976) provides further details of the use of
stat.
-
1:
– const double
Input
-
On entry: the time series, , for .
-
2:
– Integer
Input
-
On entry: the number of values, , in the time series.
Constraint:
.
-
3:
– Integer
Input
-
On entry: the number of lags, , for which the autocorrelations are required. The lags range from 1 to and do not include zero.
Constraint:
.
-
4:
– double *
Output
-
On exit: the sample mean of the input time series.
-
5:
– double *
Output
-
On exit: the sample variance of the input time series.
-
6:
– double
Output
-
On exit: the sample autocorrelation coefficient relating to lag , for .
-
7:
– double *
Output
-
On exit: the statistic used to test the hypothesis that the true autocorrelation function of the time series is identically zero.
-
8:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
The computations are believed to be stable.
In the example below, a set of 50 values of sunspot counts is used as input. The first 10 autocorrelations are computed.