

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object com.aliasi.stats.AbstractDiscreteDistribution com.aliasi.stats.PoissonDistribution com.aliasi.stats.PoissonEstimator
public class PoissonEstimator
A PoissonEstimator
implements the maximum likelihood
Poisson distribution given training events. The training events
are simply in the form of long integer outcomes. The rate
parameter for the unbiased maximum likelihood estimator is given by
the mean of the training samples.
likelihood unbiased estimator
If there have been no training events, or if all training events
have 0 values, an illegal state exception is thrown by
lambda()
and log2Prob()
.
The method compileTo(ObjectOutput)
writes a compiled
version of this distribution to the specified output. Reading it
back in will produce a constant extension of PoissonDistribution
. Poisson estimators are also serializable and
the estimator read back in will have the same state as the one
written out.
Constructor Summary  

PoissonEstimator()
Construct a Poisson estimator. 

PoissonEstimator(double priorNumSamples,
double priorMean)
Construct a Poisson estimator with a prior set by the specified number of samples and mean value. 
Method Summary  

void 
compileTo(ObjectOutput objOut)
Writes a constant Poisson distribution with the same mean as the current value of this Poisson distribution's mean. 
double 
mean()
Returns the mean for this estimator. 
void 
train(long sample)
Add the specified sample to the collection of training data. 
void 
train(long sample,
double weight)
Add the specified sample to the collection of training data with the specified weight. 
Methods inherited from class com.aliasi.stats.PoissonDistribution 

log2Probability, minOutcome, probability, variance 
Methods inherited from class com.aliasi.stats.AbstractDiscreteDistribution 

cumulativeProbability, cumulativeProbabilityGreater, cumulativeProbabilityLess, entropy, maxOutcome 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public PoissonEstimator()
public PoissonEstimator(double priorNumSamples, double priorMean)
priorNumSamples
 The initial number of samples given by
the prior.priorMean
 The initial mean.
IllegalArgumentException
 If either number is not
positive and finite.Method Detail 

public void train(long sample)
sample
 Sample to add to the training data.
IllegalArgumentException
 If the sample is less than
IllegalStateException
 If the sample would overflow the
running sum of samples.public void train(long sample, double weight)
If adding the sample to the running sum would cause overflow, it is not added and an illegal state exception is thrown instead. If overflow is a problem, samples and the resulting rates may be scaled down.
sample
 Sample to add to the training data.
IllegalArgumentException
 If the sample is less than
IllegalStateException
 If the sample would overflow the
running sum of samples.public double mean()
mean
in interface DiscreteDistribution
mean
in class PoissonDistribution
IllegalStateException
 If there have been no training
instances or all training instances had value 0, an illegal
state exception is thrown.public void compileTo(ObjectOutput objOut) throws IOException
objOut
 Object output to which a compiled version of this
distribution is written.
IllegalStateException
 If there have been no training
instances or all training instances had value 0, an illegal
state exception is thrown.
IOException


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 