public static List <double> AbnormalsX(List <double> X, double sum) { int N = 0; double t = 1.55 + 0.8 * (Math.Sqrt(Math.Abs(PointMark.Exes(X, PointMark.Ave(X), PointMark.DisSqrAve(X, PointMark.Ave(X))))) * Math.Log10(sum / 10)), A = PointMark.Ave(X) - t * PointMark.DisSqrAve(X, PointMark.Ave(X)), B = PointMark.Ave(X) + t * PointMark.DisSqrAve(X, PointMark.Ave(X)); List <double> F = new List <double>(); /*double[] Buf_allnum = new double[allnum.Length];*/ // temporary array for (int i = 0; i < sum; i++) { if (X[i] < B && X[i] > A) { F.Add(X[i]); } } X = F; N = X.Count; return(X); }
public void GridWrite(DataGridView dataGridView1, DataGridView dataGridView2, int NumClass, List <double> X) { X.Sort(); dataGridView2.ScrollBars = ScrollBars.Vertical; dataGridView2.Rows.Clear(); dataGridView2.Columns.Add("No", "Номер"); dataGridView2.Columns.Add("Element", "Значення"); for (int i = 0; i < X.Count; i++) { dataGridView2.Rows.Add(i + 1, Math.Round(X[i], 4)); } AVE = Math.Round(PointMark.Ave(X), 4); double MED = PointMark.Med(X); double MAD = PointMark.Mad(X, MED); double disp = Math.Round(PointMark.Disp(X, AVE), 4); SQRAve = Math.Round(PointMark.SQRAve(disp), 4); double disposeSQRAve = Math.Round(PointMark.DisSqrAve(X, AVE), 4); double As = Math.Round(PointMark.Assimetric(X, AVE, disposeSQRAve), 4); double Ex = Math.Round(PointMark.Exes(X, AVE, disposeSQRAve), 4); double ContrEx = Math.Round(PointMark.ConterEx(Ex), 4); double Var_Pirson = Math.Round(PointMark.Var_Pirson(AVE, SQRAve), 4); double no_param_kovar = Math.Round(PointMark.No_Param_Kovar(MED, MAD), 4); double yolsh = Math.Round(PointMark.Yolsh(X), 4); double llSQRAve = Math.Round(Interval_Mark.LowLimitSQRAve(SQRAve, sum, X), 4); double llAVE = Math.Round(Interval_Mark.LowLimitAve(AVE, SQRAve, sum, X), 4); double llAs = Math.Round(Interval_Mark.LowLimitAssimetric(As, sum, X), 4); double llEx = Math.Round(Interval_Mark.LowLimitExes(Ex, sum, X), 4); double llContrEX = Math.Round(Interval_Mark.LowLimitContrExes(ContrEx, Ex, sum, X), 4); double llPirson = Math.Round(Interval_Mark.LowLimitPirson(Var_Pirson, sum, X), 4); double hlSQRAve = Math.Round(Interval_Mark.HighLimitSQRAve(SQRAve, sum, X), 4); double hlAVE = Math.Round(Interval_Mark.HighLimitAve(AVE, SQRAve, sum, X), 4); double hlAs = Math.Round(Interval_Mark.HighLimitAssimetric(As, sum, X), 4); double hlEx = Math.Round(Interval_Mark.HighLimitExes(Ex, sum, X), 4); double hlContrEX = Math.Round(Interval_Mark.HighLimitContrExes(ContrEx, Ex, sum, X), 4); double hlPirson = Math.Round(Interval_Mark.HighLimitPirson(Var_Pirson, sum, X), 4); double sAve = Math.Round(Mark.sigmaAve(SQRAve, sum), 4); double sSQRAve = Math.Round(Mark.sigmaSQRAve(SQRAve, sum), 4); double sAs = Math.Round(Mark.sigmaAssimetric(sum), 4); double sEx = Math.Round(Mark.sigmaExes(sum), 4); double sContrEx = Math.Round(Mark.sigmaContrExes(Ex, sum), 4); double sPiroson = Math.Round(Mark.sigmaPirson(Var_Pirson, sum), 4); dataGridView1.Columns.Clear(); dataGridView1.Rows.Clear(); dataGridView1.ScrollBars = ScrollBars.Vertical; dataGridView1.AutoResizeColumns(); dataGridView1.Columns.Add("Mark", "Оцінка"); dataGridView1.Columns.Add("Lowlimit", "Нижня Границя"); dataGridView1.Columns.Add("PMark", "Точкова оцінка"); dataGridView1.Columns.Add("sigma", "σ"); dataGridView1.Columns.Add("Highlimit", "Верхня Границя"); dataGridView1.Rows.Add("MED", "", MED, "", ""); dataGridView1.Rows.Add("MAD", "", MAD, "", ""); dataGridView1.Rows.Add("Медіана середніх Уолша", "", yolsh, "", ""); dataGridView1.Rows.Add("Середнє", llAVE, AVE, sAve, hlAVE); dataGridView1.Rows.Add("Дисперсія", "", disp, "", ""); dataGridView1.Rows.Add("Середнє квадратичне відхилення", llSQRAve, SQRAve, sSQRAve, hlSQRAve); dataGridView1.Rows.Add("Коефіцієнт асиметрії", llAs, As, sAs, hlAs); dataGridView1.Rows.Add("Коефіцієнт ексцесу", llEx, Ex, sEx, hlEx); dataGridView1.Rows.Add("Коефіцієнт контрексцесу", llContrEX, ContrEx, sContrEx, hlContrEX); dataGridView1.Rows.Add("Коефіціент варіації Пірсона", llPirson, Var_Pirson, sPiroson, hlPirson); dataGridView1.Rows.Add("Непараметричний коефіцієнт варіації", "", no_param_kovar, "", ""); }