<< nan_histo Descriptive Statistics nan_histo3 >>

NaN Toolbox >> NaN Toolbox > Descriptive Statistics > nan_histo2

nan_histo2

calculates histogram for multiple columns with separate bin values for each data column.

Calling Sequence

R=nan_histo2(Y)
R = nan_histo2(Y, W)

Parameters

Y :

data

W :

weight vector containing weights of each sample, number of rows of Y and W must match. default W=[] indicates that each sample is weighted with 1.

R :

is a struct with th fields

R.X :

the bin-values, bin-values are computed separately for each data column, thus R.X is a matrix, each column contains the the bin values of for each data column, unused elements are indicated with NaN. In order to have common bin values, use nan_histo3.

R.H :

is the frequency of occurence of value X

R.N :

are the number of valid (not NaN) samples (i.e. sum of weights)

Description

more histogram-based results can be obtained by hist2res2

Examples

x= [ 9 9 9 9 2 2 3 3 4 5 9 ]';
R=nan_histo2(x);
H=nan_hist2res(R);

Bibliography

C.E. Shannon and W. Weaver "The mathematical theory of communication" University of Illinois Press, Urbana 1949 (reprint 1963).

See also

Authors


<< nan_histo Descriptive Statistics nan_histo3 >>