protected static void incrementalUpdateMean ( double [ ] mean , NumberVector vec , int newsize , double op ) { if ( newsize == 0 ) { return ; // Keep old mean } // Note: numerically stabilized version: VMath . plusTimesEquals ( mean , VMath . minusEquals ( vec . toArray ( ) , mean ) , op / newsize ) ; }
Compute an incremental update for the mean .