nan_mad Descriptive Statistics nan_meanAbsDev

NaN Toolbox >> NaN Toolbox > Descriptive Statistics > nan_mean

nan_mean

calculates the mean of data elements.

Calling Sequence

nan_mean(x)
nan_mean(x,DIM)
nan_mean(x,opt)
nan_mean(x,opt,DIM)
nan_mean(x,DIM,opt)
nan_mean(x,DIM,W)
nan_mean(x,DIM,opt,W);

Parameters

DIM:

dimension

default or []:

first DIMENSION, with more than 1 element

opt:

options

W:

weights to compute weighted mean (default: [])

Description

features:

- can deal with NaN's (missing values)

- weighting of data

- dimension argument also in 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_mean(X)
y =
3.5    3.    Nan

See also

Authors

nan_mad Descriptive Statistics nan_meanAbsDev