26package umontreal.ssj.randvar;
28import umontreal.ssj.probdist.*;
29import umontreal.ssj.rng.RandomStream;
53 protected double sigmak2;
54 protected double mean;
55 protected double invSigmae;
66 super(s, dist, kGen, h);
67 this.sigmak2 = sigmak2;
68 mean = dist.getSampleMean();
69 double var = dist.getSampleVariance();
70 invSigmae = 1.0 / Math.sqrt(1.0 + h * h * sigmak2 / var);
84 throw new IllegalArgumentException(
"h < 0");
87 invSigmae = 1.0 / Math.sqrt(1.0 + h * h * sigmak2 / var);
91 double x = mean + invSigmae * (dist.inverseF(stream.nextDouble()) - mean + 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 ).
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...
KernelDensityVarCorrectGen(RandomStream s, EmpiricalDist dist, NormalGen kGen)
This constructor uses a gaussian kernel and the default bandwidth suggested in Table  kernels for th...
double nextDouble()
Generates a random number from the continuous distribution contained in this object.
KernelDensityVarCorrectGen(RandomStream s, EmpiricalDist dist, RandomVariateGen kGen, double h, double sigmak2)
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 is the base class for all random variate generators over the real line.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...