The VARIANCE function computes the statistical variance of an n-element vector.
Result = VARIANCE( X [, /DOUBLE] [, /NAN] )
Returns the floating-point or double-precision statistical variance of the input vector.
An n-element, floating-point or double-precision vector.
If this keyword is set, VARIANCE performs its computations in double precision arithmetic and returns 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).
Set this keyword to cause the routine to check for occurrences of the IEEE floating-point values NaN or Infinity in the input data. Elements with the value NaN or Infinity are treated as missing data. (See Special Floating-Point Values for more information on IEEE floating-point values.)
; Define the n-element vector of sample data: x = [1, 1, 1, 2, 5] ; Compute the variance: result = VARIANCE(x) PRINT, result
IDL prints:
3.00000
Introduced: 5.1
KURTOSIS, MEAN, MEANABSDEV, MOMENT, STDDEV, SKEWNESS