stats/
dw_ac_test.pro
topdw_ac_test
stats
result = dw_ac_test(x, y [, PLOT=PLOT] [, SIG=SIG])
Perform the Durbin-Watson test for autocorrelation
none
none
Return value
Array of test statistic bounds on significance and 4-test statistic used for the test. [d, dL, dU, 4-d] ; To test for positive autocorrelation at significance α, the test ; statistic d is compared to lower and upper critical values (dL,α and dU,α): ; * If d < dL,α, there is statistical evidence that the error terms are positively autocorrelated. ; * If d > dU,α, there is statistical evidence that the error terms are not positively autocorrelated. ; * If dL,α < d < dU,α, the test is inconclusive. ; To test for negative autocorrelation at significance α, the test ; statistic (4 - d) is compared to lower and upper critical values (dL,α and dU,α): ; * If (4 − d) < dL,α, there is statistical evidence that the error terms are negatively autocorrelated. ; * If (4 - d) > dU,α, there is statistical evidence that the error terms are not negatively autocorrelated. ; * If dL,α < (4 − d) < dU,α, the test is inconclusive.
Parameters
- x in required
x values
- y in required
y values
Keywords
- PLOT in optional
plot the dianostic plots with the test
- SIG in optional
change the sigificance from the default 5%. Allowed values are (1, 2.5, 5)
Examples
See
http://people.bu.edu/balarsen/Home/IDL/Entries/2007/12/1_Durbin-Watson_test_for_autocorrelation.html
IDL> x=findgen(30)
IDL> y=4.*x+5+randomn(seed, 30)
IDL> print, dw_ac_test(x, y, /plot)
2.1790467 1.3520000 1.4890000 1.8209533
Author information
- History:
Sat Dec 1 14:29:31 2007, Brian Larsen formalized and tested
Statistics
| Lines: | 52 |
| McCabe complexity: |
File attributes
| Modifcation date: | Mon Sep 22 12:41:08 2008 |
| Lines: | 132 |
![[attach.png]](../idldoc-resources/attach.png)