Esempio n. 1
0
        private double[] point(double[] arr, int CountInterval)
        {
            double max = DiscriptiveStatistics.Max(arr);
            double min = DiscriptiveStatistics.Min(arr);

            double[] points = new double[CountInterval + 1];
            for (int i = 0; i < points.Length; i++)
            {
                points[i] = max - i * (max - min) / CountInterval;
            }

            return(points.OrderBy(x => x).ToArray());
        }
Esempio n. 2
0
        private double[] theoretical_freq(double[] arr, double sum, double[] xn, int CountInterval)
        {
            double X_aver = DiscriptiveStatistics.Average(arr);
            double disp   = Math.Sqrt(DiscriptiveStatistics.Dispersion(arr));

            double[] m_t = new double[CountInterval];
            double   h   = (DiscriptiveStatistics.Max(arr) - DiscriptiveStatistics.Min(arr)) / CountInterval;

            for (int i = 0; i < m_t.Length; i++)
            {
                double u   = (xn[i] - X_aver) / disp;
                double f_u = 1 / (Math.Sqrt(2 * Math.PI) * Math.Pow(Math.E, (u * u) / 2));
                m_t[i] = sum * h / disp * f_u;
            }
            return(m_t);
        }