예제 #1
0
 /**
  * Same as generatePath(), but a vector of uniform random numbers must be provided to the method.
  * These uniform random numbers are used to generate the path.
  */
 public double[] generatePath(double[] uniform01) {
   double x = x0;
   for (int j = 0; j < d; j++) {
     x += mudt[j] + sigmasqrdt[j] * NormalDist.inverseF01(uniform01[j]);
     path[j + 1] = x;
   }
   observationIndex = d;
   observationCounter = d;
   return path;
 }
예제 #2
0
 /**
  * Generates a variate from the normal distribution with parameters
  *
  * @f$\mu= @f$&nbsp;`mu` and @f$\sigma= @f$&nbsp;`sigma`, using stream `s`.
  */
 public static double nextDouble(RandomStream s, double mu, double sigma) {
   return NormalDist.inverseF(mu, sigma, s.nextDouble());
 }
예제 #3
0
 /** Creates a random variate generator for the normal distribution `dist` and stream `s`. */
 public NormalGen(RandomStream s, NormalDist dist) {
   super(s, dist);
   if (dist != null) setParams(dist.getMu(), dist.getSigma());
 }