### 2.42.31  Statistics functions acting on column matrices : mean, stddev, variance, median, quantile, quartiles, boxwhisker

The following functions work on matrices, acting column by column:

• mean computes the arithmetic means of the statistical series stored in the columns of a matrix.
Input :
mean([[3,4,2],[1,2,6]])
Output is the vector of the means of each column :
[2,3,4]
Input :
mean([[1,0,0],[0,1,0],[0,0,1]])
Output
[1/3,1/3,1/3]
• stddev computes the standard deviations of the population statistical series stored in the columns of a matrix.
Input :
stddev([[3,4,2],[1,2,6]])
Output is the vector of the standard deviations of each column :
[1,1,2]
• variance computes the variances of the statistical series stored in the columns of a matrix.
Input :
variance([[3,4,2],[1,2,6]])
Output is the vector of the variance of each column :
[1,1,4]
• median computes the medians of the statistical series stored in the columns of a matrix.
Input :
median([[6,0,1,3,4,2,5],[0,1,3,4,2,5,6],[1,3,4,2,5,6,0], [3,4,2,5,6,0,1],[4,2,5,6,0,1,3],[2,5,6,0,1,3,4]])
Output is the vector of the median of each column :
[3,3,4,4,4,3,4]
• quantile computes the deciles as specified by the second argument of the statistical series stored in the columns of a matrix.
Input :
quantile([[6,0,1,3,4,2,5],[0,1,3,4,2,5,6],[1,3,4,2,5,6,0], [3,4,2,5,6,0,1],[4,2,5,6,0,1,3],[2,5,6,0,1,3,4]],0.25)
Output is the vector of the first quartile of each column :
[1,1,2,2,1,1,1]
Input :
quantile([[6,0,1,3,4,2,5],[0,1,3,4,2,5,6],[1,3,4,2,5,6,0], [3,4,2,5,6,0,1],[4,2,5,6,0,1,3],[2,5,6,0,1,3,4]],0.75)
Output is the vector of the third quartile of each column :
[3,3,4,4,4,3,4]
• quartiles computes the minima, the first quartiles, the medians, the third quartiles and the maxima of the statistical series stored in the columns of a matrix.
Input :
quartiles([[6,0,1,3,4,2,5],[0,1,3,4,2,5,6],[1,3,4,2,5,6,0], [3,4,2,5,6,0,1], [4,2,5,6,0,1,3], [2,5,6,0,1,3,4]])
Output is a matrix, it’s first row is the minima of each column, it’s second row is the fist quartiles of each column, it’s third row the medians of each column, it’s fourth row the third quartiles of each column and its last row the maxima of each column:
[[0,0,1,0,0,0,0],[1,1,2,2,1,1,1], [2,2,3,3,2,2,3],
[3,3,4,4,4,3,4],[6,5,6,6,6,6,6]]
• boxwhisker draws the whisker boxes of the statistical series stored in the columns of a matrix .
Input :
boxwhisker([[6,0,1,3,4,2,5],[0,1,3,4,2,5,6], [1,3,4,2,5,6,0],[3,4,2,5,6,0,1], [4,2,5,6,0,1,3],[2,5,6,0,1,3,4]])
Output :
the drawing of the whisker boxes of the statistical series of each column of the matrix argument