Example #1
0
        public double mode(List <myPoint> list)
        {
            double  mode;
            myPoint m = new myPoint();

            list.Sort(m.ComparisonbyY);
            mode = list[list.Count - 1].x;
            list.Sort(m.ComparisonbyX);
            return(mode);
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Log("bt3_cl " + DateTime.Now + "\n");
            int i = 1;

            if (this.textBox4.Text == "")
            {
                MessageBox.Show("Введите мат.ожидание выборки", "Некоректные данные", MessageBoxButtons.OK, MessageBoxIcon.Error);
                i *= 0;
            }
            if (this.textBox5.Text == "")
            {
                MessageBox.Show("Введите среднеквадратическое отклонение выбоорки", "Некоректные данные", MessageBoxButtons.OK, MessageBoxIcon.Error);
                i *= 0;
            }
            if (list.Count != 0 && i != 0)
            {
                f.Q = Convert.ToDouble(textBox5.Text);
                f.M = Convert.ToDouble(textBox4.Text);
                double  q2 = f.Q * f.Q, m2 = f.M * f.M;
                myPoint m = new myPoint();
                list.Sort(m.ComparisonbyX);
                label7.Text  = Convert.ToString(Math.Round(f.aver(list), 4));
                label24.Text = textBox4.Text;
                label37.Text = Convert.ToString(Math.Round(Math.Exp((f.M + q2) / 2), 4));
                label9.Text  = Convert.ToString(Math.Round(f.mode(list), 4));
                label25.Text = Convert.ToString(f.M);
                label38.Text = Convert.ToString(Math.Round(Math.Exp(f.M - q2), 4));
                label11.Text = Convert.ToString(Math.Round(f.median(list), 4));
                label26.Text = Convert.ToString(f.M);
                label39.Text = Convert.ToString(Math.Round(Math.Exp(f.M), 4));
                label13.Text = Convert.ToString(Math.Round(f.dispersion(list), 4));
                label27.Text = Convert.ToString(Math.Round(q2, 4));
                label40.Text = Convert.ToString(Math.Round(((Math.Exp(q2) - 1) * Math.Exp(2 * f.M + q2)), 4));
                label15.Text = Convert.ToString(Math.Round(f.standart(list), 4));
                label29.Text = Convert.ToString(Math.Round(Math.Sqrt(q2), 4));
                label42.Text = Convert.ToString(Math.Round(Math.Sqrt(((Math.Exp(q2) - 1) * Math.Exp(2 * f.M + q2))), 4));
                label17.Text = Convert.ToString(Math.Round(f.excess(list), 4));
                label28.Text = Convert.ToString(0);
                label41.Text = Convert.ToString(Math.Round(Math.Exp(4 * q2) + 2 * Math.Exp(3 * q2) + 3 * Math.Exp(2 * q2) - 6, 4));
                label19.Text = Convert.ToString(Math.Round(f.asymmetry(list), 4));
                label30.Text = Convert.ToString(0);
                label43.Text = Convert.ToString(Math.Round((Math.Exp(q2) + 2) * Math.Sqrt(Math.Exp(q2) - 1), 4));
                label21.Text = Convert.ToString(Math.Round(f.minimum(list), 4));
                label23.Text = Convert.ToString(Math.Round(f.maximum(list), 4));
                gist();
                labelmake(true);
            }
        }
Example #3
0
 public int ComparisonbyY(myPoint a, myPoint b)
 {
     if (a.y == b.y)
     {
         return(0);
     }
     if (a.y > b.y)
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }
Example #4
0
 public int ComparisonbyX(myPoint a, myPoint b)
 {
     if (a.x == b.x)
     {
         return(0);
     }
     if (a.x > b.x)
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }