The MD_TEST function tests the hypothesis that a sample population is random against the hypothesis that it is not random. This two-tailed function is an extension of the “Runs Test for Randomness” and is often referred to as the Median Delta Test.
This routine is written in the IDL language. Its source code can be found in the file md_test.pro in the lib subdirectory of the IDL distribution.
Result = MD_TEST( X [, ABOVE=variable] [, BELOW=variable] [, MDC=variable] )
The result is a two-element vector containing the nearly-normal test statistic Z and its associated probability.
An n-element integer, single- or double-precision floating-point vector.
Use this keyword to specify a named variable that will contain the number of sample population values greater than the median of X.
Use this keyword to specify a named variable that will contain the number of sample population values less than the median of X.
Use this keyword to specify a named variable that will contain the number of Median Delta Clusters (sequential values of X above and below the median).
This example tests the hypothesis that X represents a random population against the hypothesis that it does not represent a random population at the 0.05 significance level:
; Define a sample population:
X = [ 2.00, 0.90, -1.44, -0.88, -0.24, 0.83, -0.84, -0.74, $
0.99, -0.82, -0.59, -1.88, -1.96, 0.77, -1.89, -0.56, $
-0.62, -0.36, -1.01, -1.36]
; Test the hypothesis that X represents a random population against
; the hypothesis that it does not represent a random population at
; the 0.05 significance level:
result = MD_TEST(X, MDC = mdc)
PRINT, result
IDL prints:
0.459468 0.322949
The computed probability (0.322949) is greater than the 0.05 significance level and therefore we do not reject the hypothesis that X represents a random population.
4.0 |
Introduced |
CTI_TEST , FV_TEST , KW_TEST , R_TEST , RS_TEST , S_TEST , TM_TEST , XSQ_TEST