Package cern.jet.random.engine

Examples of cern.jet.random.engine.RandomEngine


   * @param calculateVariance true if the variance of the result is to be calculated
   */
  public EquityVarianceSwapMonteCarloCalculator(final int seed, final boolean useAntithetics, final boolean calculateVariance) {
    _useAntithetics = useAntithetics;
    _calculateVariance = calculateVariance;
    final RandomEngine random = new MersenneTwister64(seed);
    _norm = new NormalDistribution(0, 1.0, random);
  }
View Full Code Here


        }
        return res;
      }
    };

    final RandomEngine ran = new MersenneTwister64(MersenneTwister.DEFAULT_SEED);
    final double[] temp = new double[nWeights];
    for (int i = 0; i < nWeights; i++) {
      temp[i] = ran.nextDouble();
    }
    final DoubleMatrix1D start = new DoubleMatrix1D(temp);

    final LeastSquareResults lsRes = NLLSWP.solve(new DoubleMatrix1D(obs), new DoubleMatrix1D(n, 0.01), func, jac, start, penalty);
    if(print) {
View Full Code Here

  }

  @Test
  //TODO if this interpolator cannot get the answer right then an exception should be thrown
  public void testFlat() {
    final RandomEngine random = new MersenneTwister64(MersenneTwister.DEFAULT_SEED);
    final double x1 = 10 * random.nextDouble();
    final double x2 = 10 * random.nextDouble();
    final double x3 = 10 * random.nextDouble();
    // Fails utterly for flat surface since the variogram function will be zero for all r
    final InterpolatorND interpolator = new KrigingInterpolatorND(1.99);
    final InterpolatorNDDataBundle dataBundle = interpolator.getDataBundle(FLAT_DATA);
    assertEquals(INTERPOLATOR.interpolate(dataBundle, new double[] {x1, x2, x3}), 0, 0);
  }
View Full Code Here

TOP

Related Classes of cern.jet.random.engine.RandomEngine

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.