gov.sandia.cognition.statistics.bayesian
Class DefaultBayesianParameter<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.DefaultDistributionParameter<ParameterType,ConditionalType>
              extended by gov.sandia.cognition.statistics.bayesian.DefaultBayesianParameter<ParameterType,ConditionalType,PriorType>
Type Parameters:
ParameterType - Type of parameters.
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

public class DefaultBayesianParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>
extends DefaultDistributionParameter<ParameterType,ConditionalType>
implements BayesianParameter<ParameterType,ConditionalType,PriorType>

Default implementation of BayesianParameter using reflection.

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

Field Summary
 
Fields inherited from class gov.sandia.cognition.statistics.DefaultDistributionParameter
conditionalDistribution, MEAN_GETTER, MEAN_NAME, MEAN_SETTER, parameterGetter, parameterSetter
 
Fields inherited from class gov.sandia.cognition.util.AbstractNamed
name
 
Constructor Summary
DefaultBayesianParameter(ConditionalType conditionalDistribution, String parameterName)
          Creates a new instance of DefaultBayesianParameter
DefaultBayesianParameter(ConditionalType conditionalDistribution, String parameterName, PriorType parameterPrior)
          Creates a new instance of DefaultBayesianParameter
 
Method Summary
 DefaultBayesianParameter<ParameterType,ConditionalType,PriorType> clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
static
<ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>>
DefaultBayesianParameter<ParameterType,ConditionalType,PriorType>
create(ConditionalType conditionalDistribution, String parameterName, PriorType parameterPrior)
          Creates a new instance of DefaultBayesianParameter
 PriorType getParameterPrior()
          Gets the Distribution of values that the parameter is assumed to take.
 void setParameterPrior(PriorType parameterPrior)
          Sets the Distribution of values that the parameter is assumed to take.
 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.statistics.DefaultDistributionParameter
assignParameterMethods, getConditionalDistribution, getValue, setConditionalDistribution, setName, setValue
 
Methods inherited from class gov.sandia.cognition.util.AbstractNamed
getName, 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
getConditionalDistribution, setValue
 
Methods inherited from interface gov.sandia.cognition.util.NamedValue
getValue
 
Methods inherited from interface gov.sandia.cognition.util.Named
getName
 

Constructor Detail

DefaultBayesianParameter

public DefaultBayesianParameter(ConditionalType conditionalDistribution,
                                String parameterName)
Creates a new instance of DefaultBayesianParameter

Parameters:
conditionalDistribution - Distribution from which to pull the parameters.
parameterName - Name of the parameter

DefaultBayesianParameter

public DefaultBayesianParameter(ConditionalType conditionalDistribution,
                                String parameterName,
                                PriorType parameterPrior)
Creates a new instance of DefaultBayesianParameter

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

clone

public DefaultBayesianParameter<ParameterType,ConditionalType,PriorType> 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 DefaultDistributionParameter<ParameterType,ConditionalType extends ClosedFormDistribution<?>>
Returns:
A clone of this object.

getParameterPrior

public PriorType getParameterPrior()
Description copied from interface: BayesianParameter
Gets the Distribution of values that the parameter is assumed to take.

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

public void setParameterPrior(PriorType parameterPrior)
Sets the Distribution of values that the parameter is assumed to take.

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.

create

public static <ParameterType,ConditionalType extends ClosedFormDistribution<?>,PriorType extends Distribution<ParameterType>> DefaultBayesianParameter<ParameterType,ConditionalType,PriorType> create(ConditionalType conditionalDistribution,
                                                                                                                                                                                                       String parameterName,
                                                                                                                                                                                                       PriorType parameterPrior)
Creates a new instance of DefaultBayesianParameter

Type Parameters:
ParameterType - Type of parameters.
ConditionalType - Type of parameterized distribution that generates observations.
PriorType - Assumed underlying distribution of parameters of the conditional distribution.
Parameters:
conditionalDistribution - Distribution from which to pull the parameters.
parameterName - Name of the parameter
parameterPrior - Distribution of values that the parameter is assumed to take.
Returns:
Creates a new instance of DefaultBayesianParameter