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

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,BernoulliDistribution,BetaDistribution>
              extended by gov.sandia.cognition.statistics.bayesian.conjugate.BernoulliBayesianEstimator
All Implemented Interfaces:
BatchAndIncrementalLearner<Number,BetaDistribution>, BatchLearner<Collection<? extends Number>,BetaDistribution>, IncrementalLearner<Number,BetaDistribution>, BayesianEstimator<Number,Double,BetaDistribution>, ConjugatePriorBayesianEstimator<Number,Double,BernoulliDistribution,BetaDistribution>, RecursiveBayesianEstimator<Number,Double,BetaDistribution>, CloneableSerializable, Serializable, Cloneable

@PublicationReference(author="William M. Bolstad",
                      title="Introduction to Bayesian Statistics: Second Edition",
                      type=Book,
                      year=2007,
                      pages=143)
public class BernoulliBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Number,Double,BernoulliDistribution,BetaDistribution>

A Bayesian estimator for the parameter of a BernoulliDistribution using the conjugate prior BetaDistribution.

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

Nested Class Summary
static class BernoulliBayesianEstimator.Parameter
          Parameter of this conjugate prior relationship.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  BernoulliBayesianEstimator()
          Creates a new instance of BernoulliBayesianEstimator
protected BernoulliBayesianEstimator(BayesianParameter<Double,BernoulliDistribution,BetaDistribution> parameter)
          Creates a new instance of BernoulliBayesianEstimator
  BernoulliBayesianEstimator(BernoulliDistribution conditional, BetaDistribution prior)
          Creates a new instance of BernoulliBayesianEstimator
  BernoulliBayesianEstimator(BetaDistribution prior)
          Creates a new instance of BernoulliBayesianEstimator
 
Method Summary
 double computeEquivalentSampleSize(BetaDistribution belief)
          Computes the equivalent sample size of using the given prior.
 BernoulliBayesianEstimator.Parameter createParameter(BernoulliDistribution conditional, BetaDistribution prior)
          Creates a parameter linking the conditional and prior distributions
 void update(BetaDistribution updater, Number data)
          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.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.IncrementalLearner
update
 

Constructor Detail

BernoulliBayesianEstimator

public BernoulliBayesianEstimator()
Creates a new instance of BernoulliBayesianEstimator


BernoulliBayesianEstimator

public BernoulliBayesianEstimator(BetaDistribution prior)
Creates a new instance of BernoulliBayesianEstimator

Parameters:
prior - Default conjugate prior.

BernoulliBayesianEstimator

public BernoulliBayesianEstimator(BernoulliDistribution conditional,
                                  BetaDistribution prior)
Creates a new instance of BernoulliBayesianEstimator

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

BernoulliBayesianEstimator

protected BernoulliBayesianEstimator(BayesianParameter<Double,BernoulliDistribution,BetaDistribution> parameter)
Creates a new instance of BernoulliBayesianEstimator

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

createParameter

public BernoulliBayesianEstimator.Parameter createParameter(BernoulliDistribution conditional,
                                                            BetaDistribution prior)
Description copied from interface: ConjugatePriorBayesianEstimator
Creates a parameter linking the conditional and prior distributions

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

update

public void update(BetaDistribution updater,
                   Number data)
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.

Parameters:
updater - The object to update.
data - The new data for the learning algorithm to use to update the object.

computeEquivalentSampleSize

public double computeEquivalentSampleSize(BetaDistribution 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.

Parameters:
belief - Prior belief to measure.
Returns:
Equivalent sample size of the initial belief.