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.

Examples


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.

Syntax


Result = MD_TEST( X [, ABOVE=variable] [, BELOW=variable] [, MDC=variable] )

Return Value


The result is a two-element vector containing the nearly-normal test statistic Z and its associated probability.

Arguments


X

An n-element integer, single- or double-precision floating-point vector.

Keywords


ABOVE

Use this keyword to specify a named variable that will contain the number of sample population values greater than the median of X.

BELOW

Use this keyword to specify a named variable that will contain the number of sample population values less than the median of X.

MDC

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).

Version History


4.0

Introduced

See Also


CTI_TEST, FV_TEST, KW_TEST, R_TEST, RS_TEST, S_TEST, TM_TEST, XSQ_TEST