Package cern.jet.random

Examples of cern.jet.random.ChiSquare


                               + num.format(chiSq(ids.count(id), expected)) + "\t"
                               + prct.format((ids.count(id) - expected) / expected));
            chiSq += chiSq(ids.count(id), expected);
        }
        System.out.println("X^2 = " + chiSq);
        ChiSquare dist = new ChiSquare(df, new MersenneTwister());
        // p-value is ~= prob of seeing this distribution from fair router
        double pValue = 1.0 - dist.cdf(chiSq);
        System.out.println("p-value = " + pValue);
        assertTrue("Non-uniform load distribution detected.", pValue >= 0.05);
    }
View Full Code Here


    }

    private double[] generateBootstrapSamples() {
        RandomEngine u = new MersenneTwister();
        Normal normal = new Normal(0, 1, u);
        ChiSquare chisquare = new ChiSquare(numSamples-1, u);
        int bootstrapSize = Settings.getInt("logCI.bootstrapSize", 2000);
        double[] samples = new double[bootstrapSize];
        for (int i = bootstrapSize;   i-- > 0; )
             samples[i] = generateBootstrapSample(normal, chisquare, numSamples,
                logstd);
View Full Code Here

    ////                         protected methods                 ////

    /** Method that is called after _randomNumberGenerator is changed.
     */
    protected void _createdNewRandomNumberGenerator() {
        _generator = new ChiSquare(1.0, _randomNumberGenerator);
    }
View Full Code Here

   * @param engine A uniform random number generator, not null
   */
  public ChiSquareDistribution(final double degrees, final RandomEngine engine) {
    Validate.isTrue(degrees >= 1, "Degrees of freedom must be greater than or equal to one");
    Validate.notNull(engine);
    _chiSquare = new ChiSquare(degrees, engine);
    _degrees = degrees;
  }
View Full Code Here

TOP

Related Classes of cern.jet.random.ChiSquare

Copyright © 2018 www.massapicom. 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.