fixed #448 (Calculation of mean throws an exception if the input data contains NaN values) in CEDMA refactoring branch (#419).