private void letsMathsThis(List <double> ourPi, List <double> ourXi, double count, double h) { MyMath ourOperation = new MyMath(); double[] a = ourNumber.Split(' '). Where(x => !string.IsNullOrWhiteSpace(x)). Select(x => double.Parse(x)).ToArray(); Array.Sort(a); List <double> ourNum1 = a.ToList(); // ourData2 = new DataGridView(); ourData2.Columns.Add("NAME", "NAME"); ourData2.Columns.Add("COUNT", "COUNT"); ourData2.Size = new Size(350, 200); ourData2.Location = new Point(10, 280); //СА double deltaX = 0; deltaX = ourOperation.ourDeltaX_Find(ourNum1); //СЕРЕДНЬОКВАДРАТИЧНОГО double deltaDevX = ourOperation.deltaDevX_Find(ourNum1); //КОЕФ АСИМЕТРІЇ double ourA = ourOperation.A_Find(ourNum1); double ourAС = ourOperation.AC_Find(ourNum1); //ЗСУНЕНИЙ ЕКСЦЕСУ double ourE = ourOperation.ourE_Find(ourNum1); //НЕЗСУНЕНИЙ ЕКСЦЕСУ double deltaOurE = ourOperation.ourEC_Find(ourNum1); // КОНТРЕКСЦЕСУ double ourE1 = ourOperation.ourECE_Find(ourNum1); // ВАРІАЦІЇ ПІРСОНА double ourW = ourOperation.ourW_Find(ourNum1); // double MED = ourOperation.ourMED(ourNum1); double MAD = ourOperation.ourMAD(MED); // Усічене середнє double usicheneSeredne = ourOperation.ourTrun_Average_Find(ourNum1); // deltaX = ourOperation.ourRound(deltaX, 2); deltaDevX = ourOperation.ourRound(deltaDevX, 2); ourA = ourOperation.ourRound(ourA, 2); ourAС = ourOperation.ourRound(ourAС, 2); ourE = ourOperation.ourRound(ourE, 2); ourE1 = ourOperation.ourRound(ourE1, 2); ourW = ourOperation.ourRound(ourW, 2); MED = ourOperation.ourRound(MED, 2); MAD = ourOperation.ourRound(MAD, 2); usicheneSeredne = ourOperation.ourRound(usicheneSeredne, 2); ourData2.Rows.Add("СА", $"{deltaX}"); ourData2.Rows.Add("СЕРЕДНЬОКВАДРАТИЧНОГО", $"{deltaDevX}"); ourData2.Rows.Add("КОЕФ АСИМЕТРІЇ", $"{ourA}"); ourData2.Rows.Add("КОЕФ АСИМЕТРІЇ", $"{ourAС}"); ourData2.Rows.Add("ЕКСЦЕСУ", $"{ourE}"); ourData2.Rows.Add("КОНТРЕКСЦЕСУ", $"{ourE1}"); ourData2.Rows.Add("ВАРІАЦІЇ ПІРСОНА", $"{ourW}"); ourData2.Rows.Add("MED", $"{MED}"); ourData2.Rows.Add("MAD", $"{MAD}"); ourData2.Rows.Add("УСІЧЕНЕ СЕРЕДНЄ", $"{usicheneSeredne}"); double ourOdeltaX = ourOperation.ourODeltaX_Find(ourNum1); double ourOSC = ourOperation.ourOSC_Find(ourNum1); double ourOAC = ourOperation.ourOAC_Find(ourNum1); double ourOEC = ourOperation.ourOEC_Find(ourNum1); //a == 0.05, y == 0.95 double ourS = ourOperation.ourSC_Find(ourNum1); double ourY = 0.95; double oura = 1 - ourY; int ourv = ourNum1.Count - 1; double ourStudentaT = ourOperation.ourKVANTIL_Find(ourv); ourData3.Columns.Add("o1", "o1"); ourData3.Columns.Add("0.95%", "0.95%"); ourData3.Columns.Add("o2", "o2"); ourOdeltaX = ourOperation.ourRound(ourOdeltaX, 2); ourOSC = ourOperation.ourRound(ourOSC, 2); ourOAC = ourOperation.ourRound(ourOAC, 2); ourOEC = ourOperation.ourRound(ourOEC, 2); ourData3.Rows.Add(deltaX - ourStudentaT * ourOdeltaX, "СЕРЕДНЄ", deltaX + ourStudentaT * ourOdeltaX); ourData3.Rows.Add(ourS - ourStudentaT * ourOSC, "СЕРЕДНЬОКВАДРАТИЧНЕ", ourS + ourStudentaT * ourOSC); ourData3.Rows.Add(ourAС - ourStudentaT * ourOAC, "АСИМЕТРІЯ", ourAС + ourStudentaT * ourOAC); ourData3.Rows.Add(ourE1 - ourStudentaT * ourOEC, "КОНТРЕКСЦЕСУ", ourE1 + ourStudentaT * ourOEC); ourData3.Size = new Size(350, 200); ourData3.Location = new Point(400, 280); Controls.Add(ourData2); Controls.Add(ourData3); }
private void pervunuu_Analyze(List <double> ourNum1, List <double> ourn, List <double> ourp) //x - l, n - l, p - l { Controls.Clear(); InitializeComponent(); ourData = new DataGridView(); ourData3 = new DataGridView(); chart1 = new Chart(); MyMath ourOperation = new MyMath(); // Control cnt = new Button(); cnt.Location = new Point(400, 25); cnt.Text = "Гістограмна оцінка"; cnt.Size = new Size(100, 20); cnt.Click += ourCheckBox_Click1; cnt.Enabled = false; Controls.Add(cnt); cnt = new Button(); cnt.Text = "Емпірична функція розподілу"; cnt.Click += ourCheckBox_Click2; cnt.Size = new Size(100, 20); cnt.Location = new Point(400, 45); Controls.Add(cnt); // ПЕРЕТВОРЕННЯ ДАННИХ cnt = new Button(); cnt.Location = new Point(510, 25); cnt.Text = "Без перетворення"; cnt.Size = new Size(100, 20); cnt.Click += ourButtonTOChange_1; Controls.Add(cnt); cnt = new Button(); cnt.Text = "Стандартизувати"; cnt.Size = new Size(100, 20); cnt.Click += ourButtonTOChange_3; cnt.Location = new Point(510, 45); Controls.Add(cnt); cnt = new Button(); cnt.Text = "Зсув"; cnt.Click += ourButtonTOChange_4; cnt.Size = new Size(100, 20); cnt.Location = new Point(620, 25); Controls.Add(cnt); cnt = new Button(); cnt.Click += ourButtonTOChange_2; cnt.Text = "Логарифмування"; cnt.Size = new Size(100, 20); cnt.Location = new Point(620, 45); Controls.Add(cnt); cnt = new TextBox(); if (ourM_Chang <= 0) { cnt.Text = "M"; } else { cnt.Text = $"{ourM_Chang}"; } cnt.TextChanged += ourM_Change; cnt.Size = new Size(100, 20); cnt.Location = new Point(730, 45); Controls.Add(cnt); { Control cnt2 = new Button(); cnt2.Click += ourButtonTOKillAnom; cnt2.Text = "Вилучення аномальних"; cnt2.Size = new Size(100, 20); cnt2.Location = new Point(730, 25); Controls.Add(cnt2); } //Варіаційний ряд ourData.Location = new Point(10, 70); ourData.Size = new Size(350, 200); Controls.Add(ourData); ourData.Columns.Add("x", "x"); ourData.Columns.Add("n", "n"); ourData.Columns.Add("p", "p"); for (int i = 0; i < ourNum1.Count; i++) { ourData.Rows.Add($"{ourNum1[i]}", $"{ourn[i]}", $"{ourp[i]}"); } // double count = 0; foreach (var el in ourn) { count += el; } if (ourM_Chang <= 0) { ourM = ourOperation.ourM_Find(ourn, count); Controls[8].Text = $"{ourM}"; } else { ourM = ourM_Chang; } double ourH = ourOperation.ourH_Find(ourNum1, ourM); ourHTemp = ourH; List <double> ourXi = new List <double>(); List <double> ourPi = new List <double>(); ourPi = ourOperation.ourPi_Find(ourNum1, ourp, ourH, ourM, ourNum1[0]); ourXi = ourOperation.ourXi_Find(ourNum1[0], ourH, ourM); ourH = ourOperation.ourRound(ourH, 2); ourNum1 = ourOperation.ourRound(ourNum1, 2); ourPi = ourOperation.ourRound(ourPi, 5); ourXi = ourOperation.ourRound(ourXi, 2); if (choiseOnGraph == 0) { createOurChart_GridView1(ourNum1, ourPi, ourXi, count, ourH); } else if (choiseOnGraph == 1) { createOurChart_GridView2(ourNum1, ourPi, ourXi, count, ourH); } // // letsMathsThis(ourPi, ourXi, count, ourH); // }