<< nan_trimmean Descriptive Statistics nan_y2res >>

NaN Toolbox >> NaN Toolbox > Descriptive Statistics > nan_var

nan_var

calculates the variance.

Calling Sequence

y=nan_var(x)
y=nan_var(x, opt, DIM)
y=nan_var(x, [], DIM)
y=nan_var(x, W, DIM)
y=nan_var(x, opt, DIM, W)

Parameters

opt :

0: normalizes with N-1 [default]

1:

normalizes with N

DIM :

dimension

1:

VAR of columns

2:

VAR of rows

N:

VAR of N-th dimension

default or []:

first DIMENSION, with more than 1 element

W :

weights to compute weighted variance (default: [])

y:

variance in dimension DIM, the default DIM is the first non-single dimension

Description

features: - can deal with NaN's (missing values) - weighting of data - dimension argument - compatible to Matlab and Octave

Examples

X=testmatrix('magi',3)
X([1 6:9]) = %nan*ones(1,5);
X  =
Nan   1.    Nan
3.    5.    Nan
4.    Nan   Nan
y = nan_var(X)
y =
0.5    8.    Nan

See also

Authors


Report an issue
<< nan_trimmean Descriptive Statistics nan_y2res >>