Return a new class object for accessing its methods. This ISA L object, so all the methods for loading, adding, saving, dumping, etc., data in that package are available here.
Returns the autocorrelation coefficient, the ratio of the autocovariance to variance of a sequence at any particular lag, ranging from -1 to +1, as in Chatfield (1975) and Kendall (1973). Specifically,
Data can be previously loaded or sent directly here (see L). There must be at least two elements in the data array. A croak will be heard if no data have been loaded or given here.
An integer to define how many indices ahead or behind to start correlating the data to itself, as in how many time-intervals separate one value from another. If lag is greater than or equal to number of observations, returns empty string. If the value of B is less than zero, the calculation is made with its absolute value, given that
for all I (so that a coefficient for a lag of -I is equal in magnitude I to that for +I). If a value is not given for lag, it is set to the default value of 0.
Boolean value, default = 0. In calculating the autocorrelation coefficient, the convention -- as in corporate stats programs (e.g., SPSS/PASW), and published examples of autocorrelation (e.g., L), and texts such as Chatfield (1975), and Box and Jenkins (1976) -- is to calculate the sum-of-squares for the autocovariance (the numerator term in the autocorrelation coefficient) from the residuals for each observation I from trial I = 1 (index = 0) to I - I (the lag) relative to the mean of the whole sequence:
instead of using completely pairwise products. This convention assumes that the series is stationary (has no linear or curvilinear trend, no periodicity), and that the number of observations, I, in the sample is "reasonably large". You get the autocorrelation coefficient with these assumptions, with the above formulations, by default; but if you specify B => 1, then you get the coefficient as calculated by Kendall (1973) Eq. 3.35, where the sums use not the overall sample mean, but the mean for the first to the I - I elements, and the mean from the I to I elements:
Taking each observation relative to these means, the autocovariance in the numerator, and variance in the denominator, are calculated as follows to give the autocorrelation coefficient:
Boolean, default = 1. In calculating the approximate autocovariance, it is conventional to divide the sum-product of residuals (as given above) by I, but some sources divide by I - I for less biased estimation, so that
Returns the autocorrelation coefficients for lags from 0 to a limit, or (by default) over all possible lags, from 0 to I - 1. If called in array context, returns two references: to an array of the lags, and an array of their respsective coefficients. Otherwise, returns a hash-reference of the coefficients keyed by their respective lags. The limit is given by argument B giving the number of lags to return, including the zero lag, as permitted by the data to be referenced. Options are B, B and B, as defined above for L. The autocorrelation function being symmetric about lag zero, the correlogram is based only on positive lags.
Performs a 95% confidence test of the null hypothesis of no autocorrelation, assuming that the series was generated by a Gaussian white noise process. Following Bartlett (1946), it compares the value of a single correlation coefficient for a given B with the critical values given B => 2 (default) or 1:
where I is a constant equalling 1.96 for a two-tailed, or 1.645 for a one-tailed test. If the absolute value of the sample correlation coefficient falls beyond this critical value, the null hypothesis is rejected at the 95% level.
Returns, if called in array context, a list comprising the critical value, the sample coefficient, and a boolean as to whether the null hypothesis is rejected; otherwise, just the latter boolean.
Performs a 95% confidence test of the null hypothesis of no autocorrelation, assuming that the series was generated by a Gaussian white noise process. Following Anderson (1941), it compares the value of a single correlation coefficient for a given B with the critical values given B => 2 (default) or 1:
Returns, if called in array context, a list comprising the critical value, the sample coefficient, and a boolean as to whether the null hypothesis is rejected; otherwise, just the latter boolean.
Returns the 2- or 1-tailed probability, given B => 2 (default) or 1, respectively, for the deviation of the observed autocorrelation coefficient at the given B from the expected value of zero, relative to the variance 1 / I, assuming that the series was generated by a Gaussian white noise process. If called in array context, returns both the actual I-value and then the I
-value. Other options, and methods of assigning the data to test, are as for L.
Returns the I statistic for testing whether a range of autocorrelation coefficients differs from zero, and so if the series was produced by a random process (Box & Pierce, 1970). If called in array context, returns a list giving the value of I, and, assuming I-square distribtution, its degrees of freedom (= B) and I
-value; returns the I
-value only if called in scalar context. Other options, and methods of assigning the data to test, are as for L. The range is (by default) over all possible lags from 1 to I - 1. The statistic is defined as follows:
L (L). Returns single autocorrelation coefficient which, with the present modules, would be given by L given B => 1, B => 1 (and the defaults B => 0, B => 0).