Displaying 1 result from an estimated 1 matches for "normalcdf".
2002 Aug 06
3
hard to believe speed difference
...ivariate_truncated(double mean, double var,
double lower, double upper)
{
double sd = Math.sqrt(var);
lower -= .5;
upper += .5;
double left = (lower - mean)/sd;
double right = (upper - mean)/sd;
double prob2 = Statistics.normalCdf(right) -
Statistics.normalCdf(left);
while(true)
{
harvest = mean + ran_obj.nextGaussian()*sd;
if(harvest>lower && harvest<upper) break;
}
harvest = Sfun.nearestInteger(harvest);...