ACFRAN
To test for the presence of serial correlation in a regular time series using serial correlation coefficients and the Von Neumann ratio. Significance is determined using both normal approximations and random-ization.
Calling statement
acfran c1 ;
nran k1 ;
nlag k1 (10).
Input
c1 A column of numeric data.
Missing values : Allowed. Observations with missing values are simply ignored.
Subcommands
nlag - the maximum number of lags which should be considered. Must be less than the number of
observations.
Output
For each lag from 1 to nlag, we present
· Observed autocorrelation at that lag
· Standardised autocorrelation and approximate p-value using a normal approximation
· Randomisation p-values for the autocorrelation coefficient
In addition, we present
· Observed Von Neumann ratio for the data
· Standardised VN ratio and approximate p-value using a normal approximation
· Randomisation p-values for the VN ratio
Speed of macro : FAST
Notes
If the number of observations is less than 10, then the default lag automatically changes from 10 to one less than the number of available observations.
Reference : Manly, F.J. (1997) Randomization, bootstrap and Monte Carlo methods in biology,
Chapman and Hall, London.
Null hypothesis : We test the null hypothesis that the series is random.
Alternative hypothesis :
· For the kth serial correlation coefficient : There is kth autocorrelation (short-term dependence) within the series.
· For the Von Neumann ratio : The series is a simple random walk.
Test-statistics : We use the kth sample serial correlations (for k = 1,…,nlag) as test-statistics. If the kth sample serial correlation value is significantly different from zero then this provides evidence of auto-correlation at the kth lag.
In addition, we use the Von Neumann ratio as an overall test for the presence autocorrelation. This ratio tests the null hypothesis that the series is random against the alternative hypothesis that it is a simple random walk. The Von Neumann ratio is of the form
, where xi is the ith data value.
Randomization procedure : We randomize the order of the points in the observed series, since under the null hypothesis this will random.
Standard procedure
The function
% acf c1
computes serial correlation coefficients, and produces p-values using normal approximations: If rk is the kth sample serial correlation, then under the null hypothesis the standardized version
zk = [rk + 1/(n -1)] / sqrt{1/n}
has an approximate standard normal distribution for sufficiently large n. We also include p-values based upon these normal approximations within our macro output.
Within the macro output, we provide a p-value for the Von Neumann ratio based upon a normal approximation. Under the null hypothesis, for sufficiently large n, the Von Neumann ratio has a normal distribution with mean 2 and variance 4(n-2)/(n2-1).
WORKED EXAMPLE FOR ACFRAN
Name of dataset
PROLOCULI
Description
The data are mean diameters of megalospheric proloculi of the Cretaceous bolivinid foraminifer Afrobolivina afra from 92 levels in a borehole in Gbekebo, Ondo State, Nigeria. The rank of the depth is recorded, and provides a measure of the age of the sample (1 = oldest, corresponding to late Cretaceous, 92 = youngest, corresponding to early Palaeocene). Diameters are recorded, but interest really lies in the 91 differences between diameters from adjacent depths.
Our source
Manly, F.J. (1997) Randomization, bootstrap and Monte Carlo methods in biology,
Chapman and Hall, London.
Original source
Reyment, R.A. (1982), Phenotypic evolution in a Cretaceous foraminifer, Evolution, 36, pp. 1182-1199.
Data
Number of observations = 92
Number of variables = 3
For each observation, sample number (which corresponds to rank depth) (left), diameter (middle) and difference from previous diameter (left) are given.
Sample Diam Diff Sample Diam Diff
1 156 * 47 201 -2
2 146 -10 48 261 60
3 136 -10 49 262 1
4 152 16 50 271 9
5 147 -5 51 202 -69
6 190 43 52 235 33
7 169 -21 53 214 -21
8 170 1 54 212 -2
9 179 9 55 210 -2
10 176 -3 56 241 31
11 184 8 57 211 -30
12 162 -22 58 247 36
13 155 -7 59 238 -9
14 154 -1 60 235 -3
15 151 -3 61 227 -8
16 150 -1 62 236 9
17 187 37 63 230 -6
18 220 33 64 241 11
19 205 -15 65 232 -9
20 194 -11 66 230 -2
21 221 27 67 238 8
22 185 -36 68 234 -4
23 171 -14 69 230 -4
24 177 6 70 254 24
25 194 17 71 256 2
26 176 -18 72 210 -46
27 170 -6 73 230 20
28 178 8 74 231 1
29 177 -1 75 225 -6
30 168 -9 76 227 2
31 176 8 77 226 -1
32 209 33 78 237 11
33 172 -37 79 250 13
34 195 23 80 226 -24
35 169 -26 81 229 3
36 173 4 82 240 11
37 156 -17 83 205 -35
38 161 5 84 221 16
39 161 0 85 208 -13
40 147 -14 86 207 -1
41 158 11 87 215 8
42 162 4 88 233 18
43 233 71 89 210 -23
44 184 -49 90 213 3
45 205 21 91 198 -15
46 203 -2 92 213 15
Plot
Worksheet
C1 Rank depth
C2 Diameter
C3 Distance from previous diameter
Aims of analysis
To investigate whether or not stage-to-stage differences in diameters suffer from autocorrelation.
Standard procedure
Welcome to Minitab, press F1 for help.
MTB > Retrieve "N:\resampling\Examples\Proloculi.MTW".
Retrieving worksheet from file: N:\resampling\Examples\Proloculi.MTW
# Worksheet was saved on 07/08/01 11:51:17
Results for: Proloculi.MTW
MTB > ACF 8 c3 c4.
Randomization procedure
MTB > % N:\resampling\library\acfran c3 ;
SUBC> nran 999 ;
SUBC> nlag 8 ;
SUBC> autocor m1 ;
SUBC> vonneu c5.
Executing from file: N:\resampling\library\acfran.MAC
Randomization tests for autocorrelation in a univariate time series
SERIAL CORRELATION COEFFICIENTS
for lags of 1 to k
* KEY *
> row = lag, j
> corr = observed autocorrelation at the j^th lag
> z-value = standardized autocorrelation
> normal p = p-value using normal approximation
> 1s - ran p = one-sided randomization p-value, H1: negative correlation
> 1s + ran p = one-sided randomization p-value, H1: positive correlation
> 2s ran p = two-sided randomization p-value
Data Display
Row corr z-value normal p 1s - ran p 1s + ran p 2s ran p
1 -0.421503 -3.91489 0.000090 0.001 1.000 0.002
2 0.100958 1.06907 0.285038 0.871 0.130 0.260
3 -0.102290 -0.86979 0.384417 0.182 0.819 0.364
4 0.060894 0.68689 0.492152 0.760 0.241 0.482
5 -0.135631 -1.18784 0.234895 0.123 0.878 0.246
6 0.004072 0.14484 0.884836 0.564 0.437 0.874
7 0.106034 1.11750 0.263782 0.883 0.118 0.236
8 -0.155653 -1.37885 0.167942 0.068 0.933 0.136
* NOTE * The interpretion of serial correlation p-values:
Significance levels should be reduced appropriately to
account for the effects of multiple testing. The simplest
procedure is to divide the p-value by the number of lags
being considered (this is conservative). For example, if
a 95% significance level is required and lags up to 10
are of interest, then individual p-values smaller than
0.05/10 = 0.005 are taken to be significant.
VON-NEUMANN RATIO
Data Display (WRITE)
Observed von-neumann ratio 2.835
Standardized von-neumann ratio 4.029
P-value using normal approximation 0.0001
One-sided randomization p-values 1.0000
0.0010
Two-sided randomization p-value 0.0020
* NOTE * The use of the Von-Neumann ratio :
This ratio provides a test of randomness within a time
series. It tests the null hypothesis that the observed
series is random against the alternative hypothesis that
it is a simple random walk (in which the value
at a particular point in time is partly determined by
the value at the previous time point).
Modified worksheet
C5 Column containing 999 Von Neumann ratios, one for each randomized dataset
M1 A 999*8 matrix. The kth column contains 999 serial correlation coefficients at lag k,
one for each randomzied dataset.
Discussion
Randomization and standard methods present a very similar picture. There is strong evidence of autocorrelation at lag 1 (p-value = 0.000 by standard methods, 0.002 by randomization), but no evidence of autocorrelation at any other lag. The Von-Neumann ratio also provides clear evidence against this being a random series (p-value = 0.000 by standard methods, 0.002 by randomization).
6