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

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<Double,Double,ExponentialDistribution,GammaDistribution>
              extended by gov.sandia.cognition.statistics.bayesian.conjugate.ExponentialBayesianEstimator
All Implemented Interfaces:
BatchAndIncrementalLearner<Double,GammaDistribution>, BatchLearner<Collection<? extends Double>,GammaDistribution>, IncrementalLearner<Double,GammaDistribution>, BayesianEstimator<Double,Double,GammaDistribution>, BayesianEstimatorPredictor<Double,Double,GammaDistribution>, ConjugatePriorBayesianEstimator<Double,Double,ExponentialDistribution,GammaDistribution>, ConjugatePriorBayesianEstimatorPredictor<Double,Double,ExponentialDistribution,GammaDistribution>, RecursiveBayesianEstimator<Double,Double,GammaDistribution>, CloneableSerializable, Serializable, Cloneable

@PublicationReferences(references={@PublicationReference(author="Wikipedia",title="Conjugate Prior",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/Conjugate_prior"),@PublicationReference(author={"Byron J. Gajewski","Stephen D. Simon","Susan E. Carlson"},title="Predicting accrual in clinical trials with Bayesian posterior predictive distributions",type=Journal,year=2008,publication="Statistics in Medicine",notes="They derive the predictive posterior for an inverse gamma, but we\'re using a gamma, so we have to invert the scale parameter.")})
public class ExponentialBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Double,Double,ExponentialDistribution,GammaDistribution>
implements ConjugatePriorBayesianEstimatorPredictor<Double,Double,ExponentialDistribution,GammaDistribution>

Conjugate prior Bayesian estimator of the "rate" parameter of an Exponential distribution using the conjugate prior Gamma distribution.

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

Nested Class Summary
static class ExponentialBayesianEstimator.Parameter
          Bayesian parameter describing this conjugate relationship.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  ExponentialBayesianEstimator()
          Default constructor.
protected ExponentialBayesianEstimator(BayesianParameter<Double,ExponentialDistribution,GammaDistribution> parameter)
          Creates a new instance of ExponentialBayesianEstimator
  ExponentialBayesianEstimator(ExponentialDistribution conditional, GammaDistribution prior)
          Creates a new instance of ExponentialBayesianEstimator
  ExponentialBayesianEstimator(GammaDistribution prior)
          Creates a new instance of ExponentialBayesianEstimator
 
Method Summary
 double computeEquivalentSampleSize(GammaDistribution belief)
          Computes the equivalent sample size of using the given prior.
 ExponentialBayesianEstimator.Parameter createParameter(ExponentialDistribution conditional, GammaDistribution prior)
          Creates a parameter linking the conditional and prior distributions
 ParetoDistribution createPredictiveDistribution(GammaDistribution posterior)
          Creates the predictive distribution of new data given the posterior.
 void update(GammaDistribution belief, Double 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.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

ExponentialBayesianEstimator

public ExponentialBayesianEstimator()
Default constructor.


ExponentialBayesianEstimator

public ExponentialBayesianEstimator(GammaDistribution prior)
Creates a new instance of ExponentialBayesianEstimator

Parameters:
prior - Default conjugate prior.

ExponentialBayesianEstimator

public ExponentialBayesianEstimator(ExponentialDistribution conditional,
                                    GammaDistribution prior)
Creates a new instance of ExponentialBayesianEstimator

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

ExponentialBayesianEstimator

protected ExponentialBayesianEstimator(BayesianParameter<Double,ExponentialDistribution,GammaDistribution> parameter)
Creates a new instance of ExponentialBayesianEstimator

Parameters:
parameter - Bayesian parameter describing this conjugate relationship.
Method Detail

createParameter

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

Specified by:
createParameter in interface ConjugatePriorBayesianEstimator<Double,Double,ExponentialDistribution,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

update

public void update(GammaDistribution belief,
                   Double 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.

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

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<Double,Double,ExponentialDistribution,GammaDistribution>
Parameters:
belief - Prior belief to measure.
Returns:
Equivalent sample size of the initial belief.

createPredictiveDistribution

public ParetoDistribution 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<Double,Double,GammaDistribution>
Parameters:
posterior - Posterior distribution from which to compute the predictive posterior.
Returns:
Predictive distribution of new data given the observed data.