示例#1
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 { }
 }
示例#2
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 { }
 }
示例#3
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 { }
 }
示例#4
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 { }
 }
示例#5
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("Ошибка построения регрессии");
     }
 }
示例#6
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 { }
 }
示例#7
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();
        }
示例#8
0
        void btnDropOut_Click(object sender, EventArgs e)
        {
            string strRep = "</P>ОТСЕВ ГРУБЫХ ПОГРЕШНОСТЕЙ<BR><TABLE BORDER = 3><TR>";
            bool   useStud;

            if (lvData.Items.Count > 25)
            {
                useStud = true;
            }
            else
            {
                useStud = false;
            }
            for (int i = 0; i < arrSmp.Length; i++)
            {
                strRep += string.Format("<TD>{0}</TD>", arrSmp[i].GetMark());
            }
            strRep += "<TD>Причина</TD></TR>";

            DropOutForm doForm = new DropOutForm(useStud);

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

            lvData.SuspendLayout();
            while (true)
            {
                List <int>    listIndexRemove = new List <int>();
                List <string> listReason      = new List <string>();
                foreach (Sample s in arrSmp)
                {
                    int[]    arrIndexRemove;
                    string[] arrReason;
                    if (doForm.UseStudent())
                    {
                        arrIndexRemove = s.DropoutErrorsStud(alpha, -1, out arrReason);
                    }
                    else
                    {
                        arrIndexRemove = s.DropoutErrorsTau(alpha, out arrReason);
                    }
                    for (int i = 0; i < arrIndexRemove.Length; i++)
                    {
                        int index = arrIndexRemove[i];
                        int pos   = listIndexRemove.BinarySearch(index);
                        if (pos < 0)
                        {
                            listIndexRemove.Insert(~pos, index);
                            listReason.Insert(~pos, arrReason[i]);
                        }
                    }
                }
                if (listIndexRemove.Count == 0)
                {
                    break;
                }
                int[] arrIndex = listIndexRemove.ToArray();
                for (int i = 0; i < arrIndex.Length; i++)
                {
                    strRep += "<TR>";
                    for (int j = 0; j < arrSmp.Length; j++)
                    {
                        strRep += string.Format("<TD>{0}</TD>", arrSmp[j][arrIndex[i]]);
                    }
                    strRep += string.Format("<TD>{0}</TD></TR>", listReason[i]);
                }
                foreach (Sample s in arrSmp)
                {
                    s.RemoveValues(arrIndex);
                }
                listIndexRemove.Reverse();
                foreach (int index in listIndexRemove)
                {
                    lvData.Items.RemoveAt(index);
                }
            }
            strRep += "</TABLE></P>";
            lvData.ResumeLayout();
            RepForm rForm = new RepForm("Отсев грубых погрешностей", strRep);

            rForm.ShowDialog();
        }