Language Reference


CV Function

CV (x);

The CV function is part of the IMLMLIB library . The CV function returns the sample coefficient of variation for each column of a matrix.

The coefficient of variation (CV) is the ratio of the standard deviation to the arithmetic mean. Conceptually, it is a measure of the variability; it is expressed in units of the mean. For univariate data, the CV is the quantity $100 s/\bar{x}$, where s is the sample standard deviation and $\bar{x}$ is the sample mean.

The following example computes the CV for each column of a matrix:

x = {1 0,
     2 1,
     4 2,
     8 3,
    16 . };
cv = cv(x);
print cv;

Figure 25.95: Sample Coefficient of Variation of Two Columns

cv
98.373875 86.066297