FunctionMedian of a one-dimensional distribution
Syntax C/C++#include <VFmath.h>
float VF_median( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::median();
Pascal/Delphiuses VFmath;
function VF_median( X:fVector; size:UIntSize ): Single;
DescriptionThe median of a distribution is defined as the value for which values above and below are equally probable, i.e., for which the number of elements greater and less than the median is equal. If the table X is ordered, the median is simply the element with the index (size+1)/2 (if size is odd) or the mean of the two central elements (if size is even). If a table is not ordered, VF_median finds its median by repeatedly scanning the table through, without actually sorting it.
Error handlingnone
Return valueThe median is returned.
See alsoVF_mean,   VF_meanwW,   VF_sum

VectorLib Table of Contents  OptiVec home