Пример #1
0
        public static BoxAndWhisker OutlierQuartileMedian(double[] data, double xPosition)
        {
            var baw   = new BoxAndWhisker(xPosition, data);
            var stats = new PopulationStats(data);

            baw.midline.position = stats.median;
            baw.whisker.max      = stats.highOutliers.Length == 0 ? stats.maxNonOutlier : stats.Q3 + 1.5 * stats.IQR;
            baw.whisker.min      = stats.lowOutliers.Length == 0 ? stats.minNonOutlier : stats.Q1 - 1.5 * stats.IQR;
            baw.box.max          = stats.Q3;
            baw.box.min          = stats.Q1;
            return(baw);
        }
Пример #2
0
        public static BoxAndWhisker StdevStderrMean(double[] data, double xPosition)
        {
            var baw   = new BoxAndWhisker(xPosition, data);
            var stats = new PopulationStats(data);

            baw.midline.position = stats.median;
            baw.whisker.max      = stats.max;
            baw.whisker.min      = stats.min;
            baw.box.max          = stats.mean + stats.stDev;
            baw.box.min          = stats.mean - stats.stDev;
            return(baw);
        }
Пример #3
0
        public static BoxAndWhisker GetBoxAndWhisker_OutliersAndQuartiles(double[] data, double xPosition)
        {
            var baw = new BoxAndWhisker(xPosition);

            var stats = new PopulationStats(data);

            baw.midline.position = stats.median;
            baw.whisker.max      = stats.highOutliers.Length == 0 ? stats.maxNonOutlier : stats.Q3 + 1.5 * stats.IQR;
            baw.whisker.min      = stats.lowOutliers.Length == 0 ? stats.minNonOutlier : stats.Q1 - 1.5 * stats.IQR;
            baw.box.max          = stats.Q3;
            baw.box.min          = stats.Q1;

            List <double> pointsList = new List <double>();

            pointsList.AddRange(stats.highOutliers);
            pointsList.AddRange(stats.lowOutliers);
            baw.points = pointsList.ToArray();

            return(baw);
        }