Esempio n. 1
0
 void regressionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTranSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTranSmp[i].GetName();
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName, null);
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Sample[] arrSmpX = new Sample[arrTranSmp.Length - 1];
         int      index   = sfFrom.GetIndex();
         for (int i = 0; i < index; i++)
         {
             arrSmpX[i] = arrTranSmp[i];
         }
         for (int i = index; i < arrSmpX.Length; i++)
         {
             arrSmpX[i] = arrTranSmp[i + 1];
         }
         Regression reg    = new Regression(arrTranSmp[index], arrSmpX);
         string     report = reg.GetRegReport();
         RepForm    rForm  = new RepForm("Построение регрессии", report);
         rForm.ShowDialog();
     }
     catch { }
 }
Esempio n. 2
0
 void doIdentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTranSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTranSmp[i].GetName();
         }
         SelFactorForm sFormY = new SelFactorForm(arrName, null);
         if (sFormY.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         SelFactorForm sFormX = new SelFactorForm(arrName,
                                                  "Выберете влияющий признак");
         if (sFormX.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         int       indexX = sFormX.GetIndex(), indexY = sFormY.GetIndex();
         IdentForm iForm = new IdentForm(arrSmp[indexX],
                                         arrSmp[indexY]);
         if (iForm.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         arrTranSmp[indexX] = new TranSample(arrSmp[indexX], iForm.GetTransform());
         lvSample.Items[indexX].SubItems[1].Text = iForm.GetTransform();
         arrTranSmp[indexX].DoHistogram(useSturgess);
     }
     catch { }
 }
Esempio n. 3
0
 void corrHypToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTranSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTranSmp[i].GetName();
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName, null);
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Sample[] arrSmpX = new Sample[arrTranSmp.Length - 1];
         int      index   = sfFrom.GetIndex();
         for (int i = 0; i < index; i++)
         {
             arrSmpX[i] = arrTranSmp[i];
         }
         for (int i = index; i < arrSmpX.Length; i++)
         {
             arrSmpX[i] = arrTranSmp[i + 1];
         }
         Regression reg = new Regression(arrTranSmp[index], arrSmpX);
         reg.CheckHypothesises(alpha);
         string  report = reg.GetHypCorrReport();
         RepForm rForm  = new RepForm("Проверка значимости коэффициентов корреляции", report);
         rForm.ShowDialog();
     }
     catch { }
 }
Esempio n. 4
0
 void doIdentToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTSmp[i].name;
         }
         SelFactorForm sFormY = new SelFactorForm(arrName, null);
         if (sFormY.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         SelFactorForm sFormX = new SelFactorForm(arrName,
                                                  "Выберете влияющий признак");
         if (sFormX.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         int       indexX = sFormX.index, indexY = sFormY.index;
         IdentForm iForm = new IdentForm(arrSmp[indexX],
                                         arrSmp[indexY]);
         if (iForm.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         arrTSmp[indexX] = (Sample)arrSmp[indexX].Clone();
         arrTSmp[indexX].Transform(iForm.transform);
         lvSample.Items[indexX].SubItems[1].Text = iForm.transform;
     }
     catch { }
 }
Esempio n. 5
0
 void regHypToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTSmp[i].name;
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName, null);
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Sample[] arrSmpX = new Sample[arrTSmp.Length - 1];
         int      index   = sfFrom.index;
         for (int i = 0; i < index; i++)
         {
             arrSmpX[i] = arrTSmp[i];
         }
         for (int i = index; i < arrSmpX.Length; i++)
         {
             arrSmpX[i] = arrTSmp[i + 1];
         }
         Regression reg    = new Regression(arrTSmp[index], arrSmpX);
         string     report = reg.CheckReg(alpha);
         RepForm    rForm  = new RepForm("Проверка значимости уравнения регрессии", report);
         rForm.ShowDialog();
     }
     catch { }
 }
Esempio n. 6
0
 void coeffCorrToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTSmp[i].name;
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName, null);
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Sample[] arrSmpX = new Sample[arrTSmp.Length - 1];
         int      index   = sfFrom.index;
         for (int i = 0; i < index; i++)
         {
             arrSmpX[i] = arrTSmp[i];
         }
         for (int i = index; i < arrSmpX.Length; i++)
         {
             arrSmpX[i] = arrTSmp[i + 1];
         }
         Regression reg   = new Regression(arrTSmp[index], arrSmpX);
         string     rep   = reg.GetCorrReport();
         RepForm    rForm = new RepForm("Корреляционный анализ", rep);
         rForm.ShowDialog();
     }
     catch { }
 }
Esempio n. 7
0
 void regressionToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTSmp[i].name;
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName, null);
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Sample[] arrSmpX = new Sample[arrTSmp.Length - 1];
         int      index   = sfFrom.index;
         for (int i = 0; i < index; i++)
         {
             arrSmpX[i] = arrTSmp[i];
         }
         for (int i = index; i < arrSmpX.Length; i++)
         {
             arrSmpX[i] = arrTSmp[i + 1];
         }
         Regression reg    = new Regression(arrTSmp[index], arrSmpX);
         string     report = reg.RegReport();
         RepForm    rForm  = new RepForm("Множественная регрессия", report);
         rForm.ShowDialog();
     }
     catch
     {
         MessageBox.Show("Ошибка построения регрессии");
     }
 }
Esempio n. 8
0
 void normDistHypToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try
     {
         string[] arrName = new string[arrTranSmp.Length];
         for (int i = 0; i < arrName.Length; i++)
         {
             arrName[i] = arrTranSmp[i].GetName();
         }
         SelFactorForm sfFrom = new SelFactorForm(arrName,
                                                  "Выберете исследуемый признак");
         if (sfFrom.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         int     index = sfFrom.GetIndex();
         RepForm rForm = new RepForm("Проверка нормальности выборочного закона распределения",
                                     arrSmp[index].GetHypReport());
         rForm.ShowDialog();
     }
     catch { }
 }
Esempio n. 9
0
        void btnDropOut_Click(object sender, EventArgs e)
        {
            string[] arrName = new string[arrSmp.Length];
            for (int i = 0; i < arrName.Length; i++)
            {
                arrName[i] = arrSmp[i].name;
            }
            SelFactorForm sf = new SelFactorForm(arrName, "Выберете признак");

            if (sf.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            AlphaForm doForm = new AlphaForm();

            if (doForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            double alpha = doForm.GetAlpha();
            string rep;

            int[] arrI = arrSmp[sf.index].DropoutErrors(alpha, out rep);
            foreach (Sample smp in arrSmp)
            {
                smp.RemoveValues(arrI);
            }
            dgv.SuspendLayout();
            for (int i = arrI.Length - 1; i >= 0; i--)
            {
                dgv.Rows.RemoveAt(i);
            }
            RepForm rForm = new RepForm("Отсев аномальных измерений", rep);

            rForm.ShowDialog();
        }