imat_fn/ Statistical Functions


Purpose

Calculate statistics on the supplied imat_fn, including minimum, maximum, mean, standard deviation, variance, skewness, kurtosis, and RMS.

Syntax

[g,ind]=min(f)
[g,ind]=max(f)
g=mean(f)
g=std(f)
g=std(f,1)
g=var(f)
g=var(f,1)
g=skew(f)
g=kurt(f)
g=rms(f,mode)

Description

The following statistical functions are supported.

TYPE Description
min Minimum value.
max Maximum value.
mean Mean value.
std Standard deviation.
var Variance.
skew Skewness.
kurt Kurtosis.


In each case, the function will return a matrix of the same size as F that contains the value being calculated. Some of the functions support multiple input arguments. These are described in more detail below.

Both MIN and MAX support multiple output arguments. The second output argument IND is an index into each function for the ordinate value representing the minimum or maximum value, respectively.

STD

STD normalizes F by (N-1), where N is the number of elements in each function. This is the square root of an unbiased estimator of the variance of the population from which function values are drawn, as long as these values consist of independent, identically distributed samples.

F = STD(A,1) normalizes by N and produces the square root of the second moment of the sample about its mean. STD(A,0) is the same as STD(A).

VAR

VAR normalizes F elements by N-1 if N>1, where N is the sample size in the function. This is the square root of an unbiased estimator of the variance of the population from which function values are drawn, as long as these values consist of independent, identically distributed samples. For N=1, Y is normalized by N.

F = VAR(A,1) normalizes by N and produces the second moment of the sample about its mean. VAR(A,0) is the same as VAR(A).

F = VAR(A,W) computes the variance using the weight vector W. The length of W must equal the number of elements of each function in F, and its elements must be non-negative. VAR normalizes W to sum to one.

The variance is the square of the standard deviation (STD).

SKEW

Skewness is defined as the third standardized moment, and is calculated by dividing the 3rd moment of the samples by the cube of the standard deviation, which is the variance raised to the power of 3/2.

     m3            1 / N * S (x-mean(x).^3)
g3 = ---    =   ------------------------------------
     s3         ( 1 / N * S (x-mean(x).^2) ) ^ (3/2)

 where X are the samples and N is the number of samples.

KURT

Kurtosis is defined as the fourth standardized moment, and is calculated by dividing the 4th moment of the samples by the 4th power of the standard deviation, which is the variance raised to the power of 2.

     m4         1 / N * S ( (x-mean(x).^4) / N
g4 = ---  =   ------------------------------------
     s4       ( 1 / N * S (x-mean(x).^2) ) ^ (4/2)

where X are the samples and N is the number of samples.

The kurtosis for a standard normal distribution is 3. Thus excess kurtosis is defined as KURT(A)-3. The standard normal distribution has an excess kurtosis of zero. Positive excess kurtosis indicates a "peaked" distribution and negative excess kurtosis indicates a "flat" distribution.

See Also

imat_fn/interp, imat_fn/rms