Examples of ISAACRandom


Examples of org.apache.commons.math3.random.ISAACRandom

     *
     * @param includeIntercept
     */
    private void check(boolean includeIntercept) {
        final int sets = 2;
        final ISAACRandom rand = new ISAACRandom(10L);// Seed can be changed
        final SimpleRegression whole = new SimpleRegression(includeIntercept);// regression of the whole set
        final SimpleRegression parts = new SimpleRegression(includeIntercept);// regression with parts.

        for (int s = 0; s < sets; s++) {// loop through each subset of data.
            final double coef = rand.nextDouble();
            final SimpleRegression sub = new SimpleRegression(includeIntercept);// sub regression
            for (int i = 0; i < 5; i++) { // loop through individual samlpes.
                final double x = rand.nextDouble();
                final double y = x * coef + rand.nextDouble();// some noise
                sub.addData(x, y);
                whole.addData(x, y);
            }
            parts.append(sub);
            Assert.assertTrue(equals(parts, whole, 1E-6));
View Full Code Here

Examples of org.apache.commons.math3.random.ISAACRandom

     *
     * @param includeIntercept
     */
    private void check(boolean includeIntercept) {
        final int sets = 2;
        final ISAACRandom rand = new ISAACRandom(10L);// Seed can be changed
        final SimpleRegression whole = new SimpleRegression(includeIntercept);// regression of the whole set
        final SimpleRegression parts = new SimpleRegression(includeIntercept);// regression with parts.

        for (int s = 0; s < sets; s++) {// loop through each subset of data.
            final double coef = rand.nextDouble();
            final SimpleRegression sub = new SimpleRegression(includeIntercept);// sub regression
            for (int i = 0; i < 5; i++) { // loop through individual samlpes.
                final double x = rand.nextDouble();
                final double y = x * coef + rand.nextDouble();// some noise
                sub.addData(x, y);
                whole.addData(x, y);
            }
            parts.append(sub);
            Assert.assertTrue(equals(parts, whole, 1E-6));
View Full Code Here

Examples of org.apache.commons.math3.random.ISAACRandom

    public void testEquivalence() {
        int num_sets = 2;
        StorelessBivariateCovariance cov = new StorelessBivariateCovariance();// covariance of the superset
        StorelessBivariateCovariance chk = new StorelessBivariateCovariance();// check covariance made by appending covariance of subsets
       
        ISAACRandom rand = new ISAACRandom(10L);// Seed can be changed
        for (int s = 0; s < num_sets; s++) {// loop through sets of samlpes
            StorelessBivariateCovariance covs = new StorelessBivariateCovariance();
            for (int i = 0; i < 5; i++) { // loop through individual samlpes.
                double x = rand.nextDouble();
                double y = rand.nextDouble();
                covs.increment(x, y);// add sample to the subset
                cov.increment(x, y);// add sample to the superset
            }
           chk.append(covs);
        }
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.