package umontreal.iro.lecuyer.randvar;
import umontreal.iro.lecuyer.rng.*;
import umontreal.iro.lecuyer.probdist.*;
@Deprecated
/**
* This class has been replaced by {@link GumbelGen}.
*
*
* This class implements random variate generators for the Gumbel
* (or extreme value) distribution. Its density is
*
*
*
* f (x) = λe-e-λ(x-α)-λ(x-α)
*
* where λ > 0.
*
*
* The (non-static) nextDouble method simply calls inverseF on the
* distribution.
*
*/
public class ExtremeValueGen extends RandomVariateGen {
protected double alpha = -1.0;
protected double lambda = -1.0;
/**
* Creates an extreme value random variate generator with
* parameters α = alpha and λ = lambda,
* using stream s.
*
*/
public ExtremeValueGen (RandomStream s, double alpha, double lambda) {
super (s, new ExtremeValueDist(alpha, lambda));
setParams (alpha, lambda);
}
/**
* Creates an extreme value random variate generator with
* parameters
* α = 0 and
* λ = 1, using stream s.
*
*/
public ExtremeValueGen (RandomStream s) {
this (s, 0.0, 1.0);
}
/**
* Creates a new generator object for distribution dist and
* stream s.
*
*/
public ExtremeValueGen (RandomStream s, ExtremeValueDist dist) {
super (s, dist);
if (dist != null)
setParams (dist.getAlpha(), dist.getLambda());
}
/**
* Uses inversion to generate a new variate from the extreme value
* distribution with parameters α = alpha and λ = lambda, using stream s.
*
*/
public static double nextDouble (RandomStream s, double alpha,
double lambda) {
return ExtremeValueDist.inverseF (alpha, lambda, s.nextDouble());
}
/**
* Returns the parameter α of this object.
*
*/
public double getAlpha() {
return alpha;
}
/**
* Returns the parameter λ of this object.
*
*
*/
public double getLambda() {
return lambda;
}
/**
* Sets the parameter α and λ of this object.
*
*/
protected void setParams (double alpha, double lambda) {
if (lambda <= 0.0)
throw new IllegalArgumentException ("lambda <= 0");
this.lambda = lambda;
this.alpha = alpha;
}
}
Ads help maintain this website.