|
Var
Compute the variance of values of matrix/vector elements.
double vector::Var();
|
Parameters
axis
[in] Axis. 0 — horizontal axis, 1 — vertical axis.
Return Value
Variance: scalar or vector.
Note
The variance is the average of the squared deviations from the mean, i.e., var = mean(x), where x = abs(a - a.mean())**2.
The mean is typically calculated as x.sum() / N, where N = len(x).
Example
matrixf matrix_a={{10,3,2},{1,8,12},{6,5,4},{7,11,9}};
|