/** * 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; }
/** * Generates a variate from the normal distribution with parameters * * @f$\mu= @f$ `mu` and @f$\sigma= @f$ `sigma`, using stream `s`. */ public static double nextDouble(RandomStream s, double mu, double sigma) { return NormalDist.inverseF(mu, sigma, s.nextDouble()); }
/** 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()); }