protected override double MeanDifferenceSum(int power)
        {
            DispersionInquirerBase.AssertValidPower(power);

            this.AddMeanDifference(power);
            double sum   = 0;
            var    table = this.DistributionInquirer.GetTable();

            foreach (var item in table)
            {
                sum += ((IDictionary <string, dynamic>)item)[string.Format(TaskNames.MeanDiff_Property_Format, power)];
            }

            return(sum);
        }
Exemple #2
0
        protected override double MeanDifferenceSum(int power)
        {
            DispersionInquirerBase.AssertValidPower(power);

            var    mean = this.CentralTendecyInquirer.GetMean();
            double sum  = 0;

            foreach (var item in Container.Data)
            {
                var difference    = power != 1 ? item - mean : Math.Abs(item - mean);
                var powDifference = Math.Pow(difference, power);

                sum += powDifference;
            }

            return(sum);
        }