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

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

@PublicationReferences(references={@PublicationReference(author="Jeff Grynaviski",title="Bayesian Analysis of the Normal Distribution, Part II",type=Misc,year=2009,url="http://home.uchicago.edu/~grynav/bayes/ABSLec8.ppt"),@PublicationReference(author="Wikipedia",title="Conjugate Prior",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/Conjugate_prior")})
public class UnivariateGaussianMeanVarianceBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Double,Vector,UnivariateGaussian,NormalInverseGammaDistribution>
implements ConjugatePriorBayesianEstimatorPredictor<Double,Vector,UnivariateGaussian,NormalInverseGammaDistribution>

Computes the mean and variance of a univariate Gaussian using the conjugate prior NormalInverseGammaDistribution

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

Nested Class Summary
static class UnivariateGaussianMeanVarianceBayesianEstimator.Parameter
          Parameter for this conjugate prior estimator.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  UnivariateGaussianMeanVarianceBayesianEstimator()
          Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator
protected UnivariateGaussianMeanVarianceBayesianEstimator(BayesianParameter<Vector,UnivariateGaussian,NormalInverseGammaDistribution> parameter)
          Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator
  UnivariateGaussianMeanVarianceBayesianEstimator(NormalInverseGammaDistribution prior)
          Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator
  UnivariateGaussianMeanVarianceBayesianEstimator(UnivariateGaussian conditional, NormalInverseGammaDistribution prior)
          Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator
 
Method Summary
 double computeEquivalentSampleSize(NormalInverseGammaDistribution belief)
          Computes the equivalent sample size of using the given prior.
 UnivariateGaussianMeanVarianceBayesianEstimator.Parameter createParameter(UnivariateGaussian conditional, NormalInverseGammaDistribution prior)
          Creates a parameter linking the conditional and prior distributions
 StudentTDistribution createPredictiveDistribution(NormalInverseGammaDistribution posterior)
          Creates the predictive distribution of new data given the posterior.
 void update(NormalInverseGammaDistribution target, Double data)
          The update method updates an object of ResultType using the given new data of type DataType, using some form of "learning" algorithm.
 void update(NormalInverseGammaDistribution prior, Iterable<? extends Double> data)
          The update method updates an object of ResultType using the given new Iterable containing some number 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
 
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
 

Constructor Detail

UnivariateGaussianMeanVarianceBayesianEstimator

public UnivariateGaussianMeanVarianceBayesianEstimator()
Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator


UnivariateGaussianMeanVarianceBayesianEstimator

public UnivariateGaussianMeanVarianceBayesianEstimator(NormalInverseGammaDistribution prior)
Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator

Parameters:
prior - Conjugate prior

UnivariateGaussianMeanVarianceBayesianEstimator

public UnivariateGaussianMeanVarianceBayesianEstimator(UnivariateGaussian conditional,
                                                       NormalInverseGammaDistribution prior)
Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator

Parameters:
conditional - Conditional distribution
prior - Conjugate prior

UnivariateGaussianMeanVarianceBayesianEstimator

protected UnivariateGaussianMeanVarianceBayesianEstimator(BayesianParameter<Vector,UnivariateGaussian,NormalInverseGammaDistribution> parameter)
Creates a new instance of UnivariateGaussianMeanVarianceBayesianEstimator

Parameters:
parameter - Parameter that describes the relationship between the conditional and conjugate prior
Method Detail

createParameter

public UnivariateGaussianMeanVarianceBayesianEstimator.Parameter createParameter(UnivariateGaussian conditional,
                                                                                 NormalInverseGammaDistribution prior)
Description copied from interface: ConjugatePriorBayesianEstimator
Creates a parameter linking the conditional and prior distributions

Specified by:
createParameter in interface ConjugatePriorBayesianEstimator<Double,Vector,UnivariateGaussian,NormalInverseGammaDistribution>
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(NormalInverseGammaDistribution target,
                   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,NormalInverseGammaDistribution>
Parameters:
target - The object to update.
data - The new data for the learning algorithm to use to update the object.

update

public void update(NormalInverseGammaDistribution prior,
                   Iterable<? extends Double> data)
Description copied from interface: IncrementalLearner
The update method updates an object of ResultType using the given new Iterable containing some number of type DataType, using some form of "learning" algorithm.

Specified by:
update in interface IncrementalLearner<Double,NormalInverseGammaDistribution>
Overrides:
update in class AbstractBatchAndIncrementalLearner<Double,NormalInverseGammaDistribution>
Parameters:
prior - The object to update.
data - The Iterable containing data for the learning algorithm to use to update the object.

computeEquivalentSampleSize

public double computeEquivalentSampleSize(NormalInverseGammaDistribution 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,Vector,UnivariateGaussian,NormalInverseGammaDistribution>
Parameters:
belief - Prior belief to measure.
Returns:
Equivalent sample size of the initial belief.

createPredictiveDistribution

public StudentTDistribution createPredictiveDistribution(NormalInverseGammaDistribution 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,Vector,NormalInverseGammaDistribution>
Parameters:
posterior - Posterior distribution from which to compute the predictive posterior.
Returns:
Predictive distribution of new data given the observed data.