Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.math.statistics
Class KernelDensityEstimator

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.statistics.KernelDensityEstimator

public class KernelDensityEstimator
extends Object

Estimate density given an array of points. Estimates a density using a kernel density estimator. Multiple common Kernel functions are supported.

Author:
Erich Schubert

Nested Class Summary
static class KernelDensityEstimator.Kernel
          Supported kernel functions
 
Field Summary
private  double[] dens
          Result storage: density
private static double GSCALE
          Scaling constant for Gaussian kernel
private  double[] var
          Result storage: variance / quality
 
Constructor Summary
KernelDensityEstimator(double[] data, double min, double max, KernelDensityEstimator.Kernel kernel, int windows)
          Initialize and execute kernel density estimation.
KernelDensityEstimator(double[] data, KernelDensityEstimator.Kernel kernel)
          Process an array of data
 
Method Summary
 double[] getDensity()
          Retrieve density array (NO copy)
 double[] getVariance()
          Retrieve variance/quality array (NO copy)
private  void process(double[] data, double min, double max, KernelDensityEstimator.Kernel kernel, int windows)
          Process a new array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GSCALE

private static final double GSCALE
Scaling constant for Gaussian kernel


dens

private double[] dens
Result storage: density


var

private double[] var
Result storage: variance / quality

Constructor Detail

KernelDensityEstimator

public KernelDensityEstimator(double[] data,
                              double min,
                              double max,
                              KernelDensityEstimator.Kernel kernel,
                              int windows)
Initialize and execute kernel density estimation.

Parameters:
data - data to use
min - minimum value
max - maximum value
kernel - Kernel function to use
windows - window size

KernelDensityEstimator

public KernelDensityEstimator(double[] data,
                              KernelDensityEstimator.Kernel kernel)
Process an array of data

Parameters:
data - data to process
kernel - Kernel function to use.
Method Detail

process

private void process(double[] data,
                     double min,
                     double max,
                     KernelDensityEstimator.Kernel kernel,
                     int windows)
Process a new array

Parameters:
data - data to use
min - minimum value
max - maximum value
kernel - Kernel function to use
windows - window size

getDensity

public double[] getDensity()
Retrieve density array (NO copy)

Returns:
density array

getVariance

public double[] getVariance()
Retrieve variance/quality array (NO copy)

Returns:
variance array

Release 0.2 (2009-07-06_1820)