26package umontreal.ssj.randvar;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.rng.RandomStream;
141 protected RandomVariateGen kernelGen;
142 protected double bandwidth;
143 protected boolean positive;
154 throw new IllegalArgumentException(
"h < 0");
156 throw new IllegalArgumentException(
"kGen == null");
181 double r = dist.getInterQuartileRange() / 1.34;
182 double sigma = dist.getSampleStandardDeviation();
185 return (1.36374 * r / Math.exp(0.2 * Math.log(dist.getN())));
193 throw new IllegalArgumentException(
"h < 0");
209 double x = (dist.inverseF(stream.nextDouble()) + bandwidth * kernelGen.nextDouble());
Extends DiscreteDistribution to an empirical distribution function, based on the observations (sorte...
static double getBaseBandwidth(EmpiricalDist dist)
Computes and returns the value of in ( bandwidth0 ).
void setPositiveReflection(boolean reflect)
After this method is called with true, the generator will produce only positive values,...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
KernelDensityGen(RandomStream s, EmpiricalDist dist, NormalGen kGen)
This constructor uses a gaussian kernel and the default bandwidth.
KernelDensityGen(RandomStream s, EmpiricalDist dist, RandomVariateGen kGen, double h)
Creates a new generator for a kernel density estimated from the observations given by the empirical d...
void setBandwidth(double h)
Sets the bandwidth to h.
This class implements methods for generating random variates from the normal distribution .
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...