示例#1
0
文件: Form1.cs 项目: Ovsyann/Practice
        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}";
        }
示例#2
0
文件: Form1.cs 项目: Ovsyann/Practice
        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}";
        }