Esempio n. 1
0
 public double[] GetIntersectionPoint2()
 {
     double[] Point = new double[2];
     if ((1 - GetEmpRegrXonY() * GetEmpRegrYonX()) != 0)
     {
         Point[0] = (Statistic.GetAverStatic(X) - Statistic.GetAverStatic(X) * GetEmpRegrYonX() * GetEmpRegrXonY()) / (1 - GetEmpRegrXonY() * GetEmpRegrYonX());
         Point[1] = GetEmpRegrXonY() * (Point[0] - Statistic.GetAverStatic(X)) + Statistic.GetAverStatic(Y);
         return(Point);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 2
0
 public double GetEmpRegrYonX()
 {
     return(Statistic.GetCorr(X, Y) * Statistic.GetModifyMeanSqrDeviation(Y) / Statistic.GetModifyMeanSqrDeviation(X));
 }
Esempio n. 3
0
 public string GetXYEquation()
 {
     return(String.Format("x* - {0} = {1} ( y* - {2} )", Math.Round(Statistic.GetAverStatic(X), ROUND_DIGITS), Math.Round(GetEmpRegrXonY(), ROUND_DIGITS), Math.Round(Statistic.GetAverStatic(Y), ROUND_DIGITS)));
 }
Esempio n. 4
0
 public static double GetEmpRegrXonY(double[] X, double[] Y)
 {
     return(Statistic.GetCorr(X, Y) * Statistic.GetModifyMeanSqrDeviation(X) / Statistic.GetModifyMeanSqrDeviation(Y));
 }
Esempio n. 5
0
        public static double GetCorr(double[] X, double[] Y)
        {
            double CORRxy = Statistic.GetCov(X, Y) / (GetSx(X) * GetSy(Y));

            return(CORRxy);
        }
Esempio n. 6
0
 public static double GetSy(double[] Y)
 {
     return(Statistic.GetMeanSqrDeviation(Y));
 }
Esempio n. 7
0
 public static double GetSx(double[] X)
 {
     return(Statistic.GetMeanSqrDeviation(X));
 }
Esempio n. 8
0
        public static void FillDSRGrid(double[] Elements, System.Windows.Forms.DataGridView Grid)
        {
            CRow Row = new CRow(new List <double>(Elements));

            int Length = Row.UniqLength();

            Grid.ColumnCount = 2 + Elements.Length;

            Grid.Rows.Clear();
            string[] row = new string[Grid.ColumnCount];
            row[0] = "x";
            for (int i = 0; i < Length; ++i)
            {
                row[i + 1] = Row.Elements[i].numb.ToString();
            }
            Grid.Rows.Add(row);


            row[0] = "m";
            for (int i = 0; i < Length; ++i)
            {
                row[i + 1] = Row.Elements[i].frequency.ToString();
            }
            Grid.Rows.Add(row);

            row[0] = "p*";
            for (int i = 0; i < Length; ++i)
            {
                row[i + 1] = Math.Round(Row.Elements[i].rel_frequency, LabToolz.ROUND_DIGITS).ToString();
            }
            Grid.Rows.Add(row);

            row[0] = "acum(m)";
            for (int i = 0; i < Length; ++i)
            {
                row[i + 1] = Row.Elements[i].acum_freq.ToString();
            }
            Grid.Rows.Add(row);

            row[0] = "acum(p*)";
            for (int i = 0; i < Length; ++i)
            {
                row[i + 1] = Math.Round(Row.Elements[i].acum_rel_freq, LabToolz.ROUND_DIGITS).ToString();
            }

            string[] row2 = { " " };
            Grid.Rows.Add(row2);

            row[0] = "x - averstat(x)";
            double sum      = 0;
            double averstat = Statistic.GetAverStatic(Elements);

            for (int i = 0; i < Length; ++i)
            {
                sum       += Row.Elements[i].numb - averstat;
                row[i + 1] = (Row.Elements[i].numb - averstat).ToString();
            }
            row[Length + 1] = "SUM=" + sum;
            Grid.Rows.Add(row);

            row[0]   = "(x - averstat(x))^2";
            sum      = 0;
            averstat = Statistic.GetAverStatic(Elements);
            for (int i = 0; i < Length; ++i)
            {
                sum       += (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat);
                row[i + 1] = ((Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat)).ToString();
            }
            row[Length + 1] = "SUM=" + sum;
            Grid.Rows.Add(row);

            row[0]   = "(x - averstat(x))^3";
            sum      = 0;
            averstat = Statistic.GetAverStatic(Elements);
            for (int i = 0; i < Length; ++i)
            {
                sum       += (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat);
                row[i + 1] = ((Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat)).ToString();
            }
            row[Length + 1] = "SUM=" + sum;
            Grid.Rows.Add(row);

            row[0]   = "(x - averstat(x))^4";
            sum      = 0;
            averstat = Statistic.GetAverStatic(Elements);
            for (int i = 0; i < Length; ++i)
            {
                sum       += (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat);
                row[i + 1] = ((Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat) * (Row.Elements[i].numb - averstat)).ToString();
            }
            row[Length + 1] = "SUM=" + sum;
            Grid.Rows.Add(row);

            Grid.Rows.Add(row2);

            row[0] = "x";
            row[1] = "[-intf;" + Row.Elements[0].numb.ToString() + ")";

            for (int i = 1; i < Length; ++i)
            {
                row[i + 1] = "[ " + Row.Elements[i - 1].numb.ToString() + ";" + Row.Elements[i].numb.ToString() + ")";
            }
            row[Length + 1] = "[ " + Row.Elements[Length - 1].numb.ToString() + ";+ inf]";
            Grid.Rows.Add(row);

            row[0] = "F*(x)";
            row[1] = "0";
            for (int i = 1; i < Length; ++i)
            {
                row[i + 1] = Math.Round(Row.Elements[i - 1].acum_rel_freq, LabToolz.ROUND_DIGITS).ToString();
            }
            row[Length + 1] = "1";
            Grid.Rows.Add(row);


            for (int i = 0; i < Grid.Columns.Count; ++i)
            {
                DataGridViewColumn column = Grid.Columns[i];
                column.Width = 80;
            }
        }