gov.sandia.cognition.statistics.bayesian
Class AbstractBayesianParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.util.AbstractNamed
          extended by gov.sandia.cognition.statistics.bayesian.AbstractBayesianParameter<ParameterType,ConditionalType,PriorType>
Type Parameters:
ParameterType - Type of parameter that changes the behavior of the conditional distribution.
ConditionalType - Type of parameterized distribution that generates observations.
PriorType - Assumed underlying distribution of parameters of the conditional distribution.
All Implemented Interfaces:
BayesianParameter<ParameterType,ConditionalType,PriorType>, DistributionParameter<ParameterType,ConditionalType>, CloneableSerializable, Named, NamedValue<ParameterType>, Serializable, Cloneable
Direct Known Subclasses:
BernoulliBayesianEstimator.Parameter, BinomialBayesianEstimator.Parameter, ExponentialBayesianEstimator.Parameter, GammaInverseScaleBayesianEstimator.Parameter, MultinomialBayesianEstimator.Parameter, MultivariateGaussianMeanBayesianEstimator.Parameter, MultivariateGaussianMeanCovarianceBayesianEstimator.Parameter, PoissonBayesianEstimator.Parameter, UniformDistributionBayesianEstimator.Parameter, UnivariateGaussianMeanBayesianEstimator.Parameter, UnivariateGaussianMeanVarianceBayesianEstimator.Parameter

public abstract class AbstractBayesianParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>
extends AbstractNamed
implements BayesianParameter<ParameterType,ConditionalType,PriorType>

Partial implementation of BayesianParameter

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

Field Summary
protected  ConditionalType conditionalDistribution
          Distribution from which to pull the parameters.
 
Fields inherited from class gov.sandia.cognition.util.AbstractNamed
name
 
Constructor Summary
AbstractBayesianParameter()
          Creates a new instance of AbstractBayesianParameter
AbstractBayesianParameter(ConditionalType conditionalDistribution, String name, PriorType parameterPrior)
          Creates a new instance of AbstractBayesianParameter
 
Method Summary
 AbstractNamed clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 ConditionalType getConditionalDistribution()
          Getter for conditionalDistribution
 PriorType getParameterPrior()
          Getter for parameterPrior
protected  void setConditionalDistribution(ConditionalType conditionalDistribution)
          Setter for conditionalDistribution
protected  void setParameterPrior(PriorType parameterPrior)
          Setter for parameterPrior
 void updateConditionalDistribution(Random random)
          Updates the conditional distribution by sampling from the prior distribution and assigning through the DistributionParameter.
 
Methods inherited from class gov.sandia.cognition.util.AbstractNamed
getName, setName, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.statistics.DistributionParameter
setValue
 
Methods inherited from interface gov.sandia.cognition.util.NamedValue
getValue
 
Methods inherited from interface gov.sandia.cognition.util.Named
getName
 

Field Detail

conditionalDistribution

protected ConditionalType extends ClosedFormDistribution<?> conditionalDistribution
Distribution from which to pull the parameters.

Constructor Detail

AbstractBayesianParameter

public AbstractBayesianParameter()
Creates a new instance of AbstractBayesianParameter


AbstractBayesianParameter

public AbstractBayesianParameter(ConditionalType conditionalDistribution,
                                 String name,
                                 PriorType parameterPrior)
Creates a new instance of AbstractBayesianParameter

Parameters:
conditionalDistribution - Distribution from which to pull the parameters.
name -
parameterPrior - Distribution of values that the parameter is assumed to take.
Method Detail

clone

public AbstractNamed clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractNamed
Returns:
A clone of this object.

getConditionalDistribution

public ConditionalType getConditionalDistribution()
Getter for conditionalDistribution

Specified by:
getConditionalDistribution in interface DistributionParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>>
Returns:
Distribution from which to pull the parameters.

setConditionalDistribution

protected void setConditionalDistribution(ConditionalType conditionalDistribution)
Setter for conditionalDistribution

Parameters:
conditionalDistribution - Distribution from which to pull the parameters.

getParameterPrior

public PriorType getParameterPrior()
Getter for parameterPrior

Specified by:
getParameterPrior in interface BayesianParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>
Returns:
Distribution of values that the parameter is assumed to take.

setParameterPrior

protected void setParameterPrior(PriorType parameterPrior)
Setter for parameterPrior

Parameters:
parameterPrior - Distribution of values that the parameter is assumed to take.

updateConditionalDistribution

public void updateConditionalDistribution(Random random)
Description copied from interface: BayesianParameter
Updates the conditional distribution by sampling from the prior distribution and assigning through the DistributionParameter.

Specified by:
updateConditionalDistribution in interface BayesianParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>
Parameters:
random - Random number generator to use in sampling.