weka.estimators
Class UnivariateEqualFrequencyHistogramEstimator

java.lang.Object
  extended by weka.estimators.UnivariateEqualFrequencyHistogramEstimator
All Implemented Interfaces:
UnivariateDensityEstimator, UnivariateIntervalEstimator

public class UnivariateEqualFrequencyHistogramEstimator
extends java.lang.Object
implements UnivariateDensityEstimator, UnivariateIntervalEstimator

Simple histogram density estimator. Uses equal-frequency histograms based on the specified number of bins (default: 10).

Version:
$Revision: 5680 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

Field Summary
static double CONST
          Constant for Gaussian density.
 
Constructor Summary
UnivariateEqualFrequencyHistogramEstimator()
           
 
Method Summary
 void addValue(double value, double weight)
          Adds a value to the density estimator.
 int getNumBins()
          Gets the number of bins
 boolean getUpdateWeightsOnly()
          Gets whether only weights should be udpated.*
 void initializeStatistics()
          Triggers construction of estimator based on current data and then initializes the statistics.
 double logDensity(double value)
          Returns the natural logarithm of the density estimate at the given point.
static void main(java.lang.String[] args)
          Main method, used for testing this class.
 double[][] predictIntervals(double conf)
          Returns the interval for the given confidence value.
 void setNumBins(int numBins)
          Sets the number of bins
 void setUpdateWeightsOnly(boolean flag)
          Sets whether only weights should be udpated.
 java.lang.String toString()
          Returns textual description of this estimator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONST

public static final double CONST
Constant for Gaussian density.

Constructor Detail

UnivariateEqualFrequencyHistogramEstimator

public UnivariateEqualFrequencyHistogramEstimator()
Method Detail

getNumBins

public int getNumBins()
Gets the number of bins

Returns:
the number of bins.

setNumBins

public void setNumBins(int numBins)
Sets the number of bins

Parameters:
numBins - the number of bins

initializeStatistics

public void initializeStatistics()
Triggers construction of estimator based on current data and then initializes the statistics.


setUpdateWeightsOnly

public void setUpdateWeightsOnly(boolean flag)
Sets whether only weights should be udpated.


getUpdateWeightsOnly

public boolean getUpdateWeightsOnly()
Gets whether only weights should be udpated.*


addValue

public void addValue(double value,
                     double weight)
Adds a value to the density estimator.

Specified by:
addValue in interface UnivariateDensityEstimator
Specified by:
addValue in interface UnivariateIntervalEstimator
Parameters:
value - the value to add
weight - the weight of the value

predictIntervals

public double[][] predictIntervals(double conf)
Returns the interval for the given confidence value.

Specified by:
predictIntervals in interface UnivariateIntervalEstimator
Parameters:
conf - the confidence value in the interval [0, 1]
Returns:
the interval

logDensity

public double logDensity(double value)
Returns the natural logarithm of the density estimate at the given point.

Specified by:
logDensity in interface UnivariateDensityEstimator
Parameters:
value - the value at which to evaluate
Returns:
the natural logarithm of the density estimate at the given value

toString

public java.lang.String toString()
Returns textual description of this estimator.

Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)
Main method, used for testing this class.