25package umontreal.ssj.gof;
27import umontreal.ssj.probdist.*;
57 for (
int i = 0; i < n; i++) {
58 z = (y - dist.
getObs(i)) / h;
59 if ((z >= a) && (z <= b))
81 double[] u =
new double[m];
82 for (
int j = 0; j < m; j++)
83 u[j] = estimate(dist, kern, h, Y[j]);
99 int m = evalPoints.length;
102 double invhn = 1.0 / (h * n);
103 double invh = 1.0 / h;
108 for (
int j = 0; j < m; j++) {
110 term = kern.
density((y - data[imin]) * invh);
111 while ((term < epsilon0) & (imin < n - 1) && (data[imin] < y))
112 term = kern.
density((y - data[++imin]) * invh);
114 for (
int i = imin + 1; (i < n) && ((term > epsilon0) || (data[i] < y)); i++)
116 sum += (term = kern.
density((y - data[i]) * invh));
117 density[j] = sum * invhn;
This static class provides methods to compute a kernel density estimator from a set of individual ob...
static double[] computeDensity(EmpiricalDist dist, ContinuousDistribution kern, double h, double[] Y)
Given the empirical distribution dist, this method computes the kernel density estimate at each of th...
void evalDensity(double data[], ContinuousDistribution kern, double h, double[] evalPoints, double[] density, double epsilon0)
Similar to , but much more efficient for very large n.
Classes implementing continuous distributions should inherit from this base class.
double getXinf()
Returns such that the probability density is 0 everywhere outside the interval .
double getXsup()
Returns such that the probability density is 0 everywhere outside the interval .
abstract double density(double x)
Returns , the density evaluated at .
Extends DiscreteDistribution to an empirical distribution function, based on the observations (sorte...
double getObs(int i)
Returns the value of , for .
int getN()
Returns , the number of observations.