MEANABSDEV

The MEANABSDEV function computes the mean absolute deviation (average deviation) of an n -element vector.

Calling sequence

Result = MEANABSDEV( X )

Arguments

X

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

Keywords

DOUBLE

Set this keyword to force computations to be done in double precision arithmetic and to return a double precision result. If this keyword is not set, the computations and result depend upon the type of the input data (integer and float data return float results, while double data returns double results). This has no effect if the MEDIAN keyword is set.

MEDIAN

Set this keyword to return the average deviation from the median. By default, if MEDIAN is not set, MEANABSDEV will return the average deviation from the mean.

NAN

Set this keyword to cause the routine to check for occurrences of the IEEE floating-point value NaN in the input data. Elements with the value NaN are treated as missing data. (See Special Floating-Point Values for more information on IEEE floating-point values.)

Example

x = [1, 1, 1, 2, 5]; Define an n-element vector.

result = MEANABSDEV(x); Compute average deviation from the mean.

PRINT, result ; Print the result.

IDL prints:

1.20000

See Also

, MEAN , MOMENT , STDDEV , SKEWNESS , VARIANCE