gov.sandia.cognition.statistics.bayesian.conjugate
Class PoissonBayesianEstimator

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<ObservationType,BeliefType>
          extended by gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator<Number,Double,PoissonDistribution,GammaDistribution>
              extended by gov.sandia.cognition.statistics.bayesian.conjugate.PoissonBayesianEstimator
All Implemented Interfaces:
BatchAndIncrementalLearner<Number,GammaDistribution>, BatchLearner<Collection<? extends Number>,GammaDistribution>, IncrementalLearner<Number,GammaDistribution>, BayesianEstimator<Number,Double,GammaDistribution>, BayesianEstimatorPredictor<Number,Double,GammaDistribution>, ConjugatePriorBayesianEstimator<Number,Double,PoissonDistribution,GammaDistribution>, ConjugatePriorBayesianEstimatorPredictor<Number,Double,PoissonDistribution,GammaDistribution>, RecursiveBayesianEstimator<Number,Double,GammaDistribution>, CloneableSerializable, Serializable, Cloneable

@PublicationReference(author="William M. Bolstad",
                      title="Introduction to Bayesian Statistics: Second Edition",
                      type=Book,
                      year=2007,
                      pages=185,
                      notes={"Bolstad primarily uses INVERSE shape parameter on gamma!","So we must invert his calculations for shape!"})
public class PoissonBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Number,Double,PoissonDistribution,GammaDistribution>
implements ConjugatePriorBayesianEstimatorPredictor<Number,Double,PoissonDistribution,GammaDistribution>

A Bayesian estimator for the parameter of a PoissonDistribution using the conjugate prior GammaDistribution.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
static class PoissonBayesianEstimator.Parameter
          Parameter of this conjugate prior relationship.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  PoissonBayesianEstimator()
          Creates a new instance of PoissonBayesianEstimator
protected PoissonBayesianEstimator(BayesianParameter<Double,PoissonDistribution,GammaDistribution> parameter)
          Creates a new instance
  PoissonBayesianEstimator(GammaDistribution belief)
          Creates a new instance of PoissonBayesianEstimator
  PoissonBayesianEstimator(PoissonDistribution conditional, GammaDistribution prior)
          Creates a new instance of PoissonBayesianEstimator
 
Method Summary
 double computeEquivalentSampleSize(GammaDistribution belief)
          Computes the equivalent sample size of using the given prior.
 PoissonBayesianEstimator.Parameter createParameter(PoissonDistribution conditional, GammaDistribution prior)
          Creates a parameter linking the conditional and prior distributions
 NegativeBinomialDistribution createPredictiveDistribution(GammaDistribution posterior)
          Creates the predictive distribution of new data given the posterior.
 void update(GammaDistribution belief, Number value)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 
Methods inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
clone, createConditionalDistribution, createInitialLearnedObject, getInitialBelief, getParameter, setParameter
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.bayesian.conjugate.ConjugatePriorBayesianEstimator
createConditionalDistribution, getParameter
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.IncrementalLearner
createInitialLearnedObject, update
 

Constructor Detail

PoissonBayesianEstimator

public PoissonBayesianEstimator()
Creates a new instance of PoissonBayesianEstimator


PoissonBayesianEstimator

public PoissonBayesianEstimator(GammaDistribution belief)
Creates a new instance of PoissonBayesianEstimator

Parameters:
belief - Conjugate prior belief.

PoissonBayesianEstimator

public PoissonBayesianEstimator(PoissonDistribution conditional,
                                GammaDistribution prior)
Creates a new instance of PoissonBayesianEstimator

Parameters:
prior - Default conjugate prior.
conditional - Conditional distribution of the conjugate prior.

PoissonBayesianEstimator

protected PoissonBayesianEstimator(BayesianParameter<Double,PoissonDistribution,GammaDistribution> parameter)
Creates a new instance

Parameters:
parameter - Bayesian hyperparameter relationship between the conditional distribution and the conjugate prior distribution.
Method Detail

createParameter

public PoissonBayesianEstimator.Parameter createParameter(PoissonDistribution conditional,
                                                          GammaDistribution prior)
Description copied from interface: ConjugatePriorBayesianEstimator
Creates a parameter linking the conditional and prior distributions

Specified by:
createParameter in interface ConjugatePriorBayesianEstimator<Number,Double,PoissonDistribution,GammaDistribution>
Parameters:
conditional - Distribution from which observations are generated
prior - Distribution that generates parameters for the conditional
Returns:
Parameter describing the relationship between the conditional and prior

computeEquivalentSampleSize

public double computeEquivalentSampleSize(GammaDistribution belief)
Description copied from interface: ConjugatePriorBayesianEstimator
Computes the equivalent sample size of using the given prior. This is effectively how many samples of bias the prior injects into the estimate.

Specified by:
computeEquivalentSampleSize in interface ConjugatePriorBayesianEstimator<Number,Double,PoissonDistribution,GammaDistribution>
Parameters:
belief - Prior belief to measure.
Returns:
Equivalent sample size of the initial belief.

update

public void update(GammaDistribution belief,
                   Number value)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.

Specified by:
update in interface IncrementalLearner<Number,GammaDistribution>
Parameters:
belief - The object to update.
value - The new data for the learning algorithm to use to update the object.

createPredictiveDistribution

public NegativeBinomialDistribution createPredictiveDistribution(GammaDistribution posterior)
Description copied from interface: BayesianEstimatorPredictor
Creates the predictive distribution of new data given the posterior. This is equivalent to evaluating the integral of: p( newdata | data ) = integral( conditional( newdata | data, parameters ) * p( parameters | data ) dparameters )

Specified by:
createPredictiveDistribution in interface BayesianEstimatorPredictor<Number,Double,GammaDistribution>
Parameters:
posterior - Posterior distribution from which to compute the predictive posterior.
Returns:
Predictive distribution of new data given the observed data.