private void Clear() { UD = null; ED = null; ND = null; if (PointsListUD != null) { PointsListUD.Clear(); } if (PointsListED != null) { PointsListED.Clear(); } if (PointsListND != null) { PointsListND.Clear(); } StringResult = ""; CollectionDotCharts.Clear(); }
/// <summary> /// Удаление выбросов и вывод на экран диаграмм /// </summary> private void SearchEjectionWriteResult() { int lap = 1; double[] ND_copy = new double[ND.Length]; Array.Copy(ND, ND_copy, ND.Length); bool flag = false; List <Interval> intervalRangeND; do { intervalRangeND = IntervalList.GetIntervalRange(ND_copy); ZDotChart dotChartControl = CreateDotChart(ND_copy, lap); double meanValue = IntervalList.GetMeanValue(intervalRangeND, ND_copy.Length), standartDeviation = IntervalList.GetStandardDeviation(intervalRangeND, ND_copy.Length), dispersion = IntervalList.GetDispersion(intervalRangeND, ND_copy.Length); string resTemp = "Мат ожидание: " + Math.Round(meanValue, 3).ToString() + Environment.NewLine + "σ: " + Math.Round(standartDeviation, 3).ToString() + Environment.NewLine + "Дисперсия: " + Math.Round(dispersion, 3).ToString() + Environment.NewLine; double max = ND_copy.Max(); double Tmax = (max - meanValue) / standartDeviation; double Ttabl = TableStudent.Instance[ND_copy.Length - 2]; resTemp += "Tmax(n) = " + Math.Round(Tmax, 3).ToString() + "; Tтабл = " + Math.Round(Ttabl, 3).ToString() + " " + Environment.NewLine; if (Tmax >= TableStudent.Instance[ND_copy.Length - 2]) { resTemp += "Выброс Xmax = " + Math.Round(max, 3).ToString() + "." + Environment.NewLine; var tempND = ND_copy.ToList(); tempND.Remove(max); ND_copy = tempND.ToArray(); flag = true; } else { flag = false; } intervalRangeND = IntervalList.GetIntervalRange(ND_copy); meanValue = IntervalList.GetMeanValue(intervalRangeND, ND_copy.Length); standartDeviation = IntervalList.GetStandardDeviation(intervalRangeND, ND_copy.Length); dispersion = IntervalList.GetDispersion(intervalRangeND, ND_copy.Length); resTemp += Environment.NewLine + "----------------------" + Environment.NewLine + Environment.NewLine + "Мат ожидание: " + Math.Round(meanValue, 3).ToString() + Environment.NewLine + "σ: " + Math.Round(standartDeviation, 3).ToString() + Environment.NewLine + "Дисперсия: " + Math.Round(dispersion, 3).ToString() + Environment.NewLine; double min = ND_copy.Min(); double Tmin = (meanValue - min) / standartDeviation; Ttabl = TableStudent.Instance[ND_copy.Length - 2]; resTemp += "Tmin(n) = " + Math.Round(Tmin, 3) + "; Tтабл = " + Ttabl.ToString() + " " + Environment.NewLine; if (Tmin >= TableStudent.Instance[ND_copy.Length - 2]) { resTemp += "Выброс Xmin = " + Math.Round(min, 3).ToString() + "." + Environment.NewLine; flag = true; var tempND = ND_copy.ToList(); tempND.Remove(min); ND_copy = tempND.ToArray(); } dotChartControl.TextRight = resTemp; //Построить график CollectionDotCharts.Add(dotChartControl); lap++; } while (flag); }