Examples of ChiSquaredDistribution

@version $Revision: 920852 $ $Date: 2010-03-09 13:53:44 +0100 (mar. 09 mars 2010) $
  • org.apache.commons.math3.distribution.ChiSquaredDistribution
    pedia.org/wiki/Chi-squared_distribution">Chi-squared distribution (Wikipedia) @see Chi-squared Distribution (MathWorld)

  • Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         *
         * @param df the degrees of freedom of the ChiSquare distribution
         * @return random value sampled from the ChiSquare(df) distribution
         */
        public double nextChiSquare(double df) {
            return new ChiSquaredDistribution(getRandomGenerator(), df,
                    ChiSquaredDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY).sample();
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         */
        public double chiSquareTest(final double[] expected, final long[] observed)
            throws NotPositiveException, NotStrictlyPositiveException,
            DimensionMismatchException, MaxCountExceededException {

            ChiSquaredDistribution distribution =
                new ChiSquaredDistribution(expected.length - 1.0);
            return 1.0 - distribution.cumulativeProbability(chiSquare(expected, observed));
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

            throws NullArgumentException, DimensionMismatchException,
            NotPositiveException, MaxCountExceededException {

            checkArray(counts);
            double df = ((double) counts.length -1) * ((double) counts[0].length - 1);
            ChiSquaredDistribution distribution;
            distribution = new ChiSquaredDistribution(df);
            return 1 - distribution.cumulativeProbability(chiSquare(counts));

        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         */
        public double chiSquareTestDataSetsComparison(long[] observed1, long[] observed2)
            throws DimensionMismatchException, NotPositiveException, ZeroException,
            MaxCountExceededException {

            ChiSquaredDistribution distribution;
            distribution = new ChiSquaredDistribution((double) observed1.length - 1);
            return 1 - distribution.cumulativeProbability(
                    chiSquareDataSetsComparison(observed1, observed2));

        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         *
         * @param df the degrees of freedom of the ChiSquare distribution
         * @return random value sampled from the ChiSquare(df) distribution
         */
        public double nextChiSquare(double df) {
            return new ChiSquaredDistribution(getRan(), df,
                    ChiSquaredDistribution.DEFAULT_INVERSE_ABSOLUTE_ACCURACY).sample();
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         */
        public double gTest(final double[] expected, final long[] observed)
                throws NotPositiveException, NotStrictlyPositiveException,
                DimensionMismatchException, MaxCountExceededException {

            final ChiSquaredDistribution distribution =
                    new ChiSquaredDistribution(expected.length - 1.0);
            return 1.0 - distribution.cumulativeProbability(
                    g(expected, observed));
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         */
        public double gTestIntrinsic(final double[] expected, final long[] observed)
                throws NotPositiveException, NotStrictlyPositiveException,
                DimensionMismatchException, MaxCountExceededException {

            final ChiSquaredDistribution distribution =
                    new ChiSquaredDistribution(expected.length - 2.0);
            return 1.0 - distribution.cumulativeProbability(
                    g(expected, observed));
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

         */
        public double gTestDataSetsComparison(final long[] observed1,
                final long[] observed2)
                throws DimensionMismatchException, NotPositiveException, ZeroException,
                MaxCountExceededException {
            final ChiSquaredDistribution distribution = new ChiSquaredDistribution(
                    (double) observed1.length - 1);
            return 1 - distribution.cumulativeProbability(
                    gDataSetsComparison(observed1, observed2));
        }
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

            TestUtils.assertChiSquareAccept(expected, counts, 0.001);
        }

        @Test
        public void testNextChiSquare() {
            double[] quartiles = TestUtils.getDistributionQuartiles(new ChiSquaredDistribution(12));
            long[] counts = new long[4];
            randomData.reSeed(1000);
            for (int i = 0; i < 1000; i++) {
                double value = randomData.nextChiSquare(12);
                TestUtils.updateCounts(value, counts, quartiles);
    View Full Code Here

    Examples of org.apache.commons.math3.distribution.ChiSquaredDistribution

            TestUtils.assertChiSquareAccept(expected, counts, 0.001);
        }

        @Test
        public void testNextChiSquare() throws Exception {
            double[] quartiles = TestUtils.getDistributionQuartiles(new ChiSquaredDistribution(12));
            long[] counts = new long[4];
            randomData.reSeed(1000);
            for (int i = 0; i < 1000; i++) {
                double value = randomData.nextChiSquare(12);
                TestUtils.updateCounts(value, counts, quartiles);
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.