Documentation |
Variance
y = var(X) y = var(X, 1) y = var(X, W) y = var(X, W, DIM)
X | Financial times series object. |
W | Weight vector used in calculating variance. |
DIM | Dimension of X used in calculating variance. |
var supports financial time series objects based on the MATLAB^{®} var function. See var in the MATLAB documentation.
y = var(X), if X is a financial time series object and returns the variance of each series.
var normalizes y by N – 1 if N > 1, where N is the sample size. This is an unbiased estimator of the variance of the population from which X is drawn, as long as X consists of independent, identically distributed samples. For N = 1, y is normalized by N.
y = var(X, 1) normalizes by N and produces the second moment of the sample about its mean. var(X, 0) is the same as var(X).
y = var(X, W) computes the variance using the weight vector W. The length of W must equal the length of the dimension over which var operates, and its elements must be nonnegative. var normalizes W to sum to 1. Use a value of 0 for W to use the default normalization by N – 1, or use a value of 1 to use N.
y = var(X, W, DIM) takes the variance along the dimension DIM of X.