Class NormalKernelDensityEstimator
java.lang.Object
com.compomics.util.math.statistics.distributions.NormalKernelDensityEstimator
public class NormalKernelDensityEstimator extends Object
This class makes use of "SSJ: Stochastic Simulation in Java" library from
iro.umontreal.ca to estimate probability density function of an array of
double. It first generates independent and identically distributed random
variables from the dataset, at which the density needs to be computed and
then generates the vector of density estimates at the corresponding
variables.
The KernelDensityGen class from the same library is used: the class
implements random variate generators for distributions obtained via kernel
density estimation methods from a set of n individual observations x1,...,
xn. The basic idea is to center a copy of the same symmetric density at each
observation and take an equally weighted mixture of the n copies as an
estimator of the density from which the observations come. The resulting
kernel density has the general form: fn(x) = (1/nh)?i=1nk((x - xi)/h). K is
the kernel (here a Gaussian is chosen) and h is the bandwidth (smoothing
factor).
- Author:
- Paola Masuzzo
-
Constructor Summary
Constructors Constructor Description NormalKernelDensityEstimator()
Empty default constructor -
Method Summary
Modifier and Type Method Description ArrayList
estimateDensityFunction(double[] data)
Estimate the density function.ArrayList
estimateDensityFunction(Double[] data)
Estimate the density function.double[]
excludeNullValues(Double[] data)
Exclude null values from an array of double.
-
Constructor Details
-
NormalKernelDensityEstimator
public NormalKernelDensityEstimator()Empty default constructor
-
-
Method Details
-
estimateDensityFunction
Estimate the density function.- Parameters:
data
- the data- Returns:
- the estimated density function
-
estimateDensityFunction
Estimate the density function.- Parameters:
data
- the data- Returns:
- the estimated density function
-
excludeNullValues
Exclude null values from an array of double.- Parameters:
data
- the data- Returns:
- another double array with no longer null values
-