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

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

@PublicationReferences(references={@PublicationReference(author={"Andrew Gelman","John B. Carlin","Hal S. Stern","Donald B. Rubin"},title="Bayesian Data Analysis, Second Edition",type=Book,year=2004,pages={87,88}),@PublicationReference(author="Wikipedia",title="Conjugate Prior",type=WebPage,year=2009,url="http://en.wikipedia.org/wiki/Conjugate_prior")})
public class MultivariateGaussianMeanCovarianceBayesianEstimator
extends AbstractConjugatePriorBayesianEstimator<Vector,Matrix,MultivariateGaussian,NormalInverseWishartDistribution>
implements ConjugatePriorBayesianEstimatorPredictor<Vector,Matrix,MultivariateGaussian,NormalInverseWishartDistribution>

Performs robust estimation of both the mean and covariance of a MultivariateGaussian conditional distribution using the conjugate prior Normal-Inverse-Wishart distribution. The resulting predictive distribution for future data is a multivariate Student's t-distribution.

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

Nested Class Summary
static class MultivariateGaussianMeanCovarianceBayesianEstimator.Parameter
          Parameter for this conjugate prior estimator.
 
Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.bayesian.conjugate.AbstractConjugatePriorBayesianEstimator
parameter
 
Constructor Summary
  MultivariateGaussianMeanCovarianceBayesianEstimator()
          Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator
protected MultivariateGaussianMeanCovarianceBayesianEstimator(BayesianParameter<Matrix,MultivariateGaussian,NormalInverseWishartDistribution> parameter)
          Creates a new instance
  MultivariateGaussianMeanCovarianceBayesianEstimator(int dimensionality)
          Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator
  MultivariateGaussianMeanCovarianceBayesianEstimator(MultivariateGaussian conditional, NormalInverseWishartDistribution prior)
          Creates a new instance
  MultivariateGaussianMeanCovarianceBayesianEstimator(NormalInverseWishartDistribution belief)
          Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator
 
Method Summary
 double computeEquivalentSampleSize(NormalInverseWishartDistribution belief)
          Computes the equivalent sample size of using the given prior.
 MultivariateGaussianMeanCovarianceBayesianEstimator.Parameter createParameter(MultivariateGaussian conditional, NormalInverseWishartDistribution prior)
          Creates a parameter linking the conditional and prior distributions
 MultivariateStudentTDistribution createPredictiveDistribution(NormalInverseWishartDistribution posterior)
          Creates the predictive distribution of new data given the posterior.
 void update(NormalInverseWishartDistribution prior, Iterable<? extends Vector> 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.
 void update(NormalInverseWishartDistribution target, Vector 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
 
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

MultivariateGaussianMeanCovarianceBayesianEstimator

public MultivariateGaussianMeanCovarianceBayesianEstimator()
Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator


MultivariateGaussianMeanCovarianceBayesianEstimator

public MultivariateGaussianMeanCovarianceBayesianEstimator(int dimensionality)
Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator

Parameters:
dimensionality - Dimensionality of the observations to consider.

MultivariateGaussianMeanCovarianceBayesianEstimator

public MultivariateGaussianMeanCovarianceBayesianEstimator(NormalInverseWishartDistribution belief)
Creates a new instance of MultivariateGaussianMeanCovarianceBayesianEstimator

Parameters:
belief - Initial belief of the conditional parameters

MultivariateGaussianMeanCovarianceBayesianEstimator

public MultivariateGaussianMeanCovarianceBayesianEstimator(MultivariateGaussian conditional,
                                                           NormalInverseWishartDistribution prior)
Creates a new instance

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

MultivariateGaussianMeanCovarianceBayesianEstimator

protected MultivariateGaussianMeanCovarianceBayesianEstimator(BayesianParameter<Matrix,MultivariateGaussian,NormalInverseWishartDistribution> parameter)
Creates a new instance

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

createParameter

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

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

update

public void update(NormalInverseWishartDistribution prior,
                   Iterable<? extends Vector> 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<Vector,NormalInverseWishartDistribution>
Overrides:
update in class AbstractBatchAndIncrementalLearner<Vector,NormalInverseWishartDistribution>
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(NormalInverseWishartDistribution 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<Vector,Matrix,MultivariateGaussian,NormalInverseWishartDistribution>
Parameters:
belief - Prior belief to measure.
Returns:
Equivalent sample size of the initial belief.

createPredictiveDistribution

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