Esempio n. 1
0
        /// <summary>
        /// Evaluates the root mean square (RMS) also known as quadratic mean.
        /// Returns NaN if data is empty or if any entry is NaN.
        /// </summary>
        /// <param name="data">The data to calculate the RMS of.</param>
        public static double RootMeanSquare(this IEnumerable <double> data)
        {
            var array = data as double[];

            return(array != null
                ? ArrayStatistics.RootMeanSquare(array)
                : StreamingStatistics.RootMeanSquare(data));
        }