<< mps_mean Statistics mps_variance >>

mpscilab >> mpscilab > Statistics > mps_stdev

mps_stdev

Standard deviation of a vector/matrix entries

Calling Sequence

mps_stdev( rop, op [,orientation] [, w] )
rop = mps_stdev( rop, op [,orientation] [, w] )

Arguments

rop

multi-precision matrix

op

Multi-precision matrix

op

Scalar integer (1 or 0)

Description

Computes the standard deviation of a matrix's elements. The option argument w can be used to select the normalization factor. With w = 1, the default, the result is normalized with N - 1 with N being the number of elements used in the standard deviation estimation. Otherwise with w = 0, the result is normalized with N.

mps_stdev( rop, op [, orientation] [, w] )

Computes the standard deviation of all of the elements of op along the specified orientation and returns the result in rop. The orientation is specified as a single character either '*', 'r' and 'c' respectively for row, column and whole matrix.

rop = mps_stdev( op [, orientation] [, w] )

Creates a multi-precision matrix of the correct size and with the same precision as op containing the result.

Usage notes

The standard deviation is evaluated using a corrected two-pass algorithm minimizing the loss of precision.

Examples

// Variance of a matrix.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(1,1,100)
rop = mps_stdev(op)

// Variance of each rows of a matrix.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(2,1,100)
mps_stdev(rop,op,'r')

//Variance using N instead of N - 1.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(1,1,100)
mps_stdev(rop,op,'*',0)

See Also

<< mps_mean Statistics mps_variance >>