Home > tsa > sumskipnan.m

sumskipnan

PURPOSE ^

SUMSKIPNAN adds all non-NaN values.

SYNOPSIS ^

function [o,count,SSQ,S4M] = sumskipnan(i,DIM)

DESCRIPTION ^

 SUMSKIPNAN adds all non-NaN values. 

 All NaN's are skipped; NaN's are considered as missing values. 
 SUMSKIPNAN of NaN's only  gives O; and the number of valid elements is return. 
 SUMSKIPNAN is also the elementary function for calculating 
 various statistics (e.g. MEAN, STD, VAR, RMS, MEANSQ, SKEWNESS, 
 KURTOSIS, MOMENT, STATISTIC etc.) from data with missing values.  
 SUMSKIPNAN implements the DIMENSION-argument for data with missing values.
 Also the second output argument return the number of valid elements (not NaNs) 
 
 Y = sumskipnan(x [,DIM])
 [Y,N,SSQ] = sumskipnan(x [,DIM])
 
 DIM    dimension
    1 sum of columns
    2 sum of rows
    default or []: first DIMENSION with more than 1 element

 Y    resulting sum
 N    number of valid (not missing) elements
 SSQ    sum of squares

 The mean & standard error of the mean and 
    Y./N & sqrt((SSQ-Y.*Y./N)./(N.*max(N-1,0))); 
 the mean square & the standard error of the mean square and
     SSQ./N & sqrt((S4M-SSQ.^2./N)./(N.*max(N-1,0)))

 features:
 - can deal with NaN's (missing values)
 - implements dimension argument. 
 - compatible with Matlab and Octave

 see also: SUM, NANSUM, MEAN, STD, VAR, RMS, MEANSQ,
      SSQ, MOMENT, SKEWNESS, KURTOSIS, SEM

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003