STD

Purpose:

Calculates the sample or population standard deviation of a series.

Syntax:

STD(series, dof, dim, "naflag")

series

-

A series or array, the input series

dof

-

Optional. An integer, the degrees of freedom normalization mode. For N = length(series):

0

:

sample variance, normalize by 1/(N-1) (default)

1

:

population variance, normalize by 1/N

dim

-

Optional. An integer or string, the computation dimension.

0

:

calculate over full array

1

:

calculate row-wise (default)

2

:

calculate column-wise

"all"

:

calculate over full array

"naflag"

-

Optional. A string, the NA handling method.

"omitnan"

:

ignore NA values (default)

"includenan"

:

include NA values

Returns:

A real scalar for a one column series or a 1xM real table for an M column series.

Example:

W1: 1..10

std(W1)

 

returns 3.0277 the sample standard deviation.

Example:

W1: 1..10

std(W1 + 1e7)

 

Returns 3.0277, same as above since the true standard deviation is independent of the mean value.

Example:

W1: 1..10

std(W1, 1)

 

Returns 2.8723, the population standard deviation.

Example:

W1: ravel(1..9, 3)^2

W2: std(W1, 0)

W3: std(W1, 0, 2)

W4: {std(w1, 0, 0)}

 

W1 == {{1, 16, 49}

       {4, 25, 64},

       {9, 36, 81}}

 

W2 == {{4.0415, 10.0167, 16.0104}}

 

W3 == {24.5561,

       30.4467,

       36.3731}

 

W4 == {28.0802}

 

W2 computes the standard deviation of each column of W1 and W3 computes the standard deviation of each row of W1.

W4 computes the standard deviation of the entire array.

Remarks:

For a series of length N, the basic form of the sample standard deviation (dof == 0) is:

 

sample standard deviation

 

where the arithmetic mean is defined as:

 

mean

 

The population standard deviation (dof == 1) is defined as:

 

population standard deviation

 

STD uses a fast, highly accurate running sums algorithm that exhibits insensitivity to round-off errors.

 

As shown in the second example, the standard deviation is independent of an additive mean value.

 

By default, NaN values are ignored. Set "naflag" to "includenan" to include nan values.

 

STD returns the standard deviation of each column or row for a multi-column series. Set dim = 0 or dim = "all" to compute the variance of the entire array.

 

See STDEV to return the standard deviation of a multi-column series as a whole.

 

See VAR to compute the variance.

 

See MOVSTD to compute the centered moving standard deviation.

See Also:

COLSTDEV

KURTOSIS

MEAN

MOVSTD

RMS

ROWSTDEV

SKEW

STATS

STDERR

STDEV

VAR

XMOVSTD