Package org.jamesii.core.math.random.distributions

Examples of org.jamesii.core.math.random.distributions.NormalDistribution


              .intValue();
      addEdge(tree, actualNodeNum, oldLevel.get(randomParent));
      nodesOnLevel.add(actualNodeNum);
      actualNodeNum++;
      AbstractNormalDistribution normDist =
          new NormalDistribution(rand, 0., 1.);

      for (int i : oldLevel) {

        randomNumber =
            approxNumberOfChildren + 0.25 * approxNumberOfChildren
                * normDist.getRandomNumber();

        while (randomNumber > 0.5 && actualNodeNum < numOfNodes) {
          addEdge(tree, actualNodeNum, i);
          nodesOnLevel.add(actualNodeNum);
          actualNodeNum++;
View Full Code Here


   *          the val
   */
  public NormalNode(IRandom val) {
    super();
    random = val;
    distrib = new NormalDistribution(random);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public <N extends INode> N calc(IEnvironment<?> cEnv) {

    distrib =
        new NormalDistribution(random,
            ((ValueNode<Double>) lowerB.calc(cEnv)).getValue(),
            ((ValueNode<Double>) upperB.calc(cEnv)).getValue());

    return (N) new ValueNode<>(distrib.getRandomNumber());
  }
View Full Code Here

    algorithmPerformance = new IDistribution[numOfAlgosPerCluster];
    // TODO: generalise, to be able to set arbitrary distributions!
    // algorithmPerformance[i] = new ErlangDistribution(rng, 0.5, 2);
    for (int i = 0; i < numOfAlgosPerCluster; i++) {
      algorithmPerformance[i] =
          new NormalDistribution(rng, 0, Math.abs(deviationDistribution
              .getRandomNumber()));
    }
  }
View Full Code Here

      clusters[j] =
          new AlgorithmCluster(rng, numOfAlgoPerCluster, deviationDistribution);
    }

    problemDifficulty = new double[numOfProblems];
    NormalDistribution distributionProblems =
        new NormalDistribution(rng, 0.0, 0.5 * distanceBetweenAlgoClusters);
    for (int i = 0; i < numOfProblems; i++) {
      problemDifficulty[i] = distributionProblems.getRandomNumber();
    }
  }
View Full Code Here

    upDown(td);

    BimodalDistribution md = getDistrib(new BimodalDistributionFactory());
    upDown(md);

    NormalDistribution nod = getDistrib(new NormalDistributionFactory());
    upDown(nod);
  }
View Full Code Here

  /**
   * Test simple rejection with a second set of time series generated with a
   * higher mean.
   */
  public void testSimpleRejectionWithHigherMean() {
    testWithRandomData(true, DEFAULT_RANDOM_DIST, new NormalDistribution(
        SimSystem.getRNGGenerator().getNextRNG(), HIGHER_MEAN_FOR_TESTING, 1));
  }
View Full Code Here

  /**
   * Test simple rejection with a second set of time series generated with a
   * lower variance.
   */
  public void testSimpleRejectionWithLowerVariance() {
    testWithRandomData(true, DEFAULT_RANDOM_DIST, new NormalDistribution(
        SimSystem.getRNGGenerator().getNextRNG(), 0,
        LOWER_STANDARD_DEV_FOR_TESTING));
  }
View Full Code Here

  }

  /** Applies test to normally distributed and binomially distributed samples. */
  public void testNormalVsBinomialSample() {
    List<Double> normalDistSample =
        getRandomSample(new NormalDistribution(random, 5.0, 2.0));
    List<Double> binomialDistSample =
        getRandomSample(new BinomialDistribution(random));
    checkTestResult(normalDistSample, binomialDistSample);
  }
View Full Code Here

  }

  /** Applies test to normally distributed and binomially distributed samples. */
  public void testRandomSamplesFromSameDistribution() {
    List<Double> normalDistSample1 =
        getRandomSample(new NormalDistribution(random, 5.0, 2.0));
    List<Double> normalDistSample2 =
        getRandomSample(new NormalDistribution(random, 5.0, 2.0));
    assertFalse(
        "This null hypothesis should not be easy to reject, as both samples are indeed generated by the same distribution.",
        test.executeTest(normalDistSample1, normalDistSample2) < MAXIMAL_P_VALUE);
  }
View Full Code Here

TOP

Related Classes of org.jamesii.core.math.random.distributions.NormalDistribution

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.