Exemplo n.º 1
0
        private void Lab2KolmogorovTest(double[] randomVariables, int sampleSize)
        {
            double[] sortedSamples;
            double   lambdaKolmogorov;

            sortedSamples            = Lab2TestMethods.SortSamples(randomVariables);
            lambdaKolmogorov         = Lab2TestMethods.KolmogorovMethod(sortedSamples, ref sampleSize);
            labelKolmogorovTest.Text = string.Format("Критерий Колмогорова = {0}", lambdaKolmogorov);
        }
Exemplo n.º 2
0
        void Lab2PearsonTest(double[] randomVariables)
        {
            double subdivisionStep = (double)1 / generationMethod.numberOfSubdivisions;

            double[] hitCounts        = new double[generationMethod.numberOfSubdivisions];
            double[] hitProbabilities = new double[generationMethod.numberOfSubdivisions];

            for (int i = 0; i < generationMethod.numberOfSubdivisions; i++)
            {
                hitCounts[i]        = randomVariables.Count(p => p >= i * subdivisionStep && p < (i + 1) * subdivisionStep);
                hitProbabilities[i] = subdivisionStep;
            }

            double Xi2;

            Xi2 = Lab2TestMethods.PearsonMethod(hitCounts, hitProbabilities,
                                                generationMethod.numberOfSubdivisions, generationMethod.sampleSize);
            labelPearsonTest.Text = string.Format("Pearson test Xi2 = {0}", Xi2);
        }
Exemplo n.º 3
0
        private void Lab2CollectorTest(double[] randomVariables, int sampleSize, int subdivisionsAmount)
        {
            double Xi2 = Lab2TestMethods.GetCollector(subdivisionsAmount, sampleSize, randomVariables);

            labelCollectorTest.Text = string.Format("Collector test Xi2 = {0}", Xi2);
        }