Ejemplo n.º 1
0
        private void CalculateBoxAndMahlerMethod()
        {
            BoxAndMahlerMethod rnd = new BoxAndMahlerMethod();

            double[] randomValues = rnd.Random(sampleSize, m, dpow2);

            double step = (double)rightXBorder / intervalsCount;

            ConstructBoxAndMahlerfrequencies(randomValues, step);
            ConstructBoxAndMahlerDistributionFunc(randomValues, step);

            double mx = StatisticData.CalculateMathExpectation(randomValues);
            double dx = StatisticData.CalculateDispersoin(randomValues, mx);

            label3.Text = "M(X) = " + mx + "   D(X) = " + dx;
            //вычисление критерия Колмагорова
            double kolmogorovCriterionLambdaValue = KolmogorovCriterion.GetLambda(randomValues, sampleSize);
            double kolmogorovCriterionValue       = KolmogorovCriterion.Calculate(randomValues, sampleSize);

            label4.Text = $"Лямбда по критерию Колмогорова равна {Math.Round(kolmogorovCriterionLambdaValue, 3)}; \nОценка генератора " +
                          $"случайных чисел равна {kolmogorovCriterionValue}";
        }
Ejemplo n.º 2
0
        private void CalculateCentralLimitTheorem()
        {
            CentralLimitTheorem rnd = new CentralLimitTheorem();

            double[] randomValues = rnd.Random(sampleSize, m, dpow2);

            double step = (double)rightXBorder / intervalsCount;

            ConstructFrequencyHistogram(randomValues, step);

            ConstructStatisticalDistributionFunction(randomValues, step);

            double mx = StatisticData.CalculateMathExpectation(randomValues);
            double dx = StatisticData.CalculateDispersoin(randomValues, mx);

            label1.Text = "M(X) = " + mx + "   D(X) = " + dx;
            //вычисление критерия Колмагорова
            double kolmogorovCriterionLambdaValue = KolmogorovCriterion.GetLambda(randomValues, sampleSize);
            double kolmogorovCriterionValue       = KolmogorovCriterion.Calculate(randomValues, sampleSize);

            label2.Text = $"Лямбда по критерию Колмогорова равна {Math.Round(kolmogorovCriterionLambdaValue, 3)}; \nОценка генератора " +
                          $"случайных чисел равна {kolmogorovCriterionValue}";
        }