Пример #1
0
        /// <summary>
        /// Estimates the sample median from the provided samples (R8).
        /// </summary>
        /// <param name="data">The data sample sequence.</param>
        public static double Median(this IEnumerable <double?> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            var array = data.Where(d => d.HasValue).Select(d => d.Value).ToArray();

            return(ArrayStatistics.MedianInplace(array));
        }
Пример #2
0
        /// <summary>
        /// Estimates the sample median from the provided samples (R8).
        /// </summary>
        /// <param name="data">The data sample sequence.</param>
        public static double Median(this IEnumerable <double> data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            var array = data.ToArray();

            return(ArrayStatistics.MedianInplace(array));
        }
Пример #3
0
        /// <summary>
        /// Estimates the sample median from the provided samples (R8).
        /// </summary>
        /// <param name="data">The data sample sequence.</param>
        public static double Median(this IEnumerable <double?> data)
        {
            var array = data.Where(d => d.HasValue).Select(d => d.Value).ToArray();

            return(ArrayStatistics.MedianInplace(array));
        }
Пример #4
0
        /// <summary>
        /// Estimates the sample median from the provided samples (R8).
        /// </summary>
        /// <param name="data">The data sample sequence.</param>
        public static double Median(this IEnumerable <double> data)
        {
            var array = data.ToArray();

            return(ArrayStatistics.MedianInplace(array));
        }