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

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

@PublicationReference(author="William M. Bolstad",
                      title="Introduction to Bayesian Statistics: Second Edition",
                      type=Book,
                      year=2007,
                      pages=208)
public class UnivariateGaussianMeanBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Double,Double,UnivariateGaussian,UnivariateGaussian>
implements ConjugatePriorBayesianEstimatorPredictor<Double,Double,UnivariateGaussian,UnivariateGaussian>

Bayesian estimator for the mean of a UnivariateGaussian using its conjugate prior, which is also a UnivariateGaussian. This estimation method assumes that the variance of the estimated mean is known.

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

Nested Class Summary
static class UnivariateGaussianMeanBayesianEstimator.Parameter
          Parameter of this conjugate prior relationship.
 
Field Summary
static double DEFAULT_KNOWN_VARIANCE
          Default known variance of the estimated distribution, 1.0.
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  UnivariateGaussianMeanBayesianEstimator()
          Creates a new instance of UnivariateGaussianMeanBayesianEstimator
protected UnivariateGaussianMeanBayesianEstimator(BayesianParameter<Double,UnivariateGaussian,UnivariateGaussian> parameter)
          Creates a new instance
  UnivariateGaussianMeanBayesianEstimator(double knownVariance)
          Creates a new instance of UnivariateGaussianMeanBayesianEstimator
  UnivariateGaussianMeanBayesianEstimator(double knownVariance, UnivariateGaussian belief)
          Creates a new instance of UnivariateGaussianMeanBayesianEstimator
  UnivariateGaussianMeanBayesianEstimator(UnivariateGaussian conditional, UnivariateGaussian prior)
          Creates a new instance
 
Method Summary
 double computeEquivalentSampleSize(UnivariateGaussian belief)
          Computes the equivalent sample size of using the given prior.
 UnivariateGaussianMeanBayesianEstimator.Parameter createParameter(UnivariateGaussian conditional, UnivariateGaussian prior)
          Creates a parameter linking the conditional and prior distributions
 UnivariateGaussian createPredictiveDistribution(UnivariateGaussian posterior)
          Creates the predictive distribution from the given posterior.
 double getKnownVariance()
          Getter for knownVariance.
 void setKnownVariance(double knownVariance)
          Setter for knownVariance.
 void update(UnivariateGaussian updater, 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
 

Field Detail

DEFAULT_KNOWN_VARIANCE

public static final double DEFAULT_KNOWN_VARIANCE
Default known variance of the estimated distribution, 1.0.

See Also:
Constant Field Values
Constructor Detail

UnivariateGaussianMeanBayesianEstimator

public UnivariateGaussianMeanBayesianEstimator()
Creates a new instance of UnivariateGaussianMeanBayesianEstimator


UnivariateGaussianMeanBayesianEstimator

public UnivariateGaussianMeanBayesianEstimator(double knownVariance)
Creates a new instance of UnivariateGaussianMeanBayesianEstimator

Parameters:
knownVariance - Known variance of the distribution.

UnivariateGaussianMeanBayesianEstimator

public UnivariateGaussianMeanBayesianEstimator(double knownVariance,
                                               UnivariateGaussian belief)
Creates a new instance of UnivariateGaussianMeanBayesianEstimator

Parameters:
belief - Conjugate prior of the posterior belief.
knownVariance - Known variance of the distribution.

UnivariateGaussianMeanBayesianEstimator

public UnivariateGaussianMeanBayesianEstimator(UnivariateGaussian conditional,
                                               UnivariateGaussian prior)
Creates a new instance

Parameters:
conditional - Distribution from which observations are generated
prior - Conjugate prior to the conditional distribution

UnivariateGaussianMeanBayesianEstimator

protected UnivariateGaussianMeanBayesianEstimator(BayesianParameter<Double,UnivariateGaussian,UnivariateGaussian> parameter)
Creates a new instance

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

createParameter

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

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

getKnownVariance

public double getKnownVariance()
Getter for knownVariance.

Returns:
Known variance of the distribution.

setKnownVariance

public void setKnownVariance(double knownVariance)
Setter for knownVariance.

Parameters:
knownVariance - Known variance of the distribution.

update

public void update(UnivariateGaussian updater,
                   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,UnivariateGaussian>
Parameters:
updater - The object to update.
data - The new data for the learning algorithm to use to update the object.

computeEquivalentSampleSize

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

createPredictiveDistribution

public UnivariateGaussian createPredictiveDistribution(UnivariateGaussian posterior)
Creates the predictive distribution from the given posterior.

Specified by:
createPredictiveDistribution in interface BayesianEstimatorPredictor<Double,Double,UnivariateGaussian>
Parameters:
posterior - Posterior from which to create the predictive distribution
Returns:
Predictive distribution from the posterior.