Statistics Toolbox
  Go to function:
    Search    Help Desk 
var    Examples   See Also

Variance of a sample.

Syntax

Description

var(X) computes the variance of the data in X. For vectors, var(x) is the variance of the elements in x. For matrices, var(X) is a row vector containing the variance of each column of X.

var(x) normalizes by n-1 where n is the sequence length. For normally distributed data, this makes var(x) the minimum variance unbiased estimator MVUE of 2(the second parameter) .

var(x,1) normalizes by n and yields the second moment of the sample data about its mean (moment of inertia).

var(X,w) computes the variance using the vector of weights, w. The number of elements in w must equal the number of rows in the matrix, X. For vector x, w and x must match in length. Each element of w must be positive.

var supports both common definitions of variance. Let SS be the sum of
the squared deviations of the elements of a vector x, from their mean. Then, var(x) = SS/(n-1) the MVUE, and var(x,1) = SS/n the maximum likelihood estimator (MLE) of 2.

Examples

See Also



[ Previous | Help Desk | Next ]