Navigation

Operators and Keywords

Function List:

C++ API

: std (x)
: std (x, opt)
: std (x, opt, dim)

Compute the standard deviation of the elements of the vector x.

The standard deviation is defined as

std (x) = sqrt ( 1/(N-1) SUM_i (x(i) - mean(x))^2 )

where N is the number of elements.

If x is a matrix, compute the standard deviation for each column and return them in a row vector.

The argument opt determines the type of normalization to use. Valid values are

0:

normalize with N-1, provides the square root of the best unbiased estimator of the variance [default]

1:

normalize with N, this provides the square root of the second moment around the mean

If the optional argument dim is given, operate along this dimension.

See also: var, range, iqr, mean, median.

Package: octave