Package weka.estimators
Class UnivariateKernelEstimator
java.lang.Object
weka.estimators.UnivariateKernelEstimator
- All Implemented Interfaces:
Serializable,RevisionHandler,UnivariateDensityEstimator,UnivariateIntervalEstimator,UnivariateQuantileEstimator
public class UnivariateKernelEstimator
extends Object
implements UnivariateDensityEstimator, UnivariateIntervalEstimator, UnivariateQuantileEstimator, Serializable
Simple weighted kernel density estimator.
- Version:
- $Revision: 11318 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddValue(double value, double weight) Adds a value to the density estimator.Returns the revision string.Returns a string describing the estimator.doublelogDensity(double value) Returns the natural logarithm of the density estimate at the given point.static voidMain method, used for testing this class.double[][]predictIntervals(double conf) Returns the interval for the given confidence value.doublepredictQuantile(double percentage) Returns the quantile for the given percentage.toString()Returns textual description of this estimator.voidUpdates bandwidth: the sample standard deviation is multiplied by the total weight to the power of the given exponent.
-
Field Details
-
CONST
public static final double CONSTConstant for Gaussian density.
-
-
Constructor Details
-
UnivariateKernelEstimator
public UnivariateKernelEstimator()
-
-
Method Details
-
globalInfo
Returns a string describing the estimator. -
addValue
public void addValue(double value, double weight) Adds a value to the density estimator.- Specified by:
addValuein interfaceUnivariateDensityEstimator- Specified by:
addValuein interfaceUnivariateIntervalEstimator- Specified by:
addValuein interfaceUnivariateQuantileEstimator- Parameters:
value- the value to addweight- the weight of the value
-
updateWidth
public void updateWidth()Updates bandwidth: the sample standard deviation is multiplied by the total weight to the power of the given exponent. If the total weight is not greater than zero, the width is set to Double.MAX_VALUE. If that is not the case, but the width becomes smaller than m_MinWidth, the width is set to the value of m_MinWidth. -
predictIntervals
public double[][] predictIntervals(double conf) Returns the interval for the given confidence value.- Specified by:
predictIntervalsin interfaceUnivariateIntervalEstimator- Parameters:
conf- the confidence value in the interval [0, 1]- Returns:
- the interval
-
predictQuantile
public double predictQuantile(double percentage) Returns the quantile for the given percentage.- Specified by:
predictQuantilein interfaceUnivariateQuantileEstimator- Parameters:
percentage- the percentage- Returns:
- the quantile
-
logDensity
public double logDensity(double value) Returns the natural logarithm of the density estimate at the given point.- Specified by:
logDensityin interfaceUnivariateDensityEstimator- Parameters:
value- the value at which to evaluate- Returns:
- the natural logarithm of the density estimate at the given value
-
toString
Returns textual description of this estimator. -
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
main
Main method, used for testing this class.
-