Cognitoware.Robotics.dll
Class ConditionalValueMap<X, Y>
X: The values whose probabilities are dependent on Y.
Y: The values which affect the probability of X.
Summary
A discrete distribution P(XY) that simple maps values of X and Y to a probability value.
Constructor Summary
Method Summary
Applies Bayes' Rule to the conditional distribution using a specific value of X.
Returns the probability of a specific value result given a specific value range.
Creates a probability distribution of X conditioned on a specific value of Y.
Equals(Object)
Inherited from System.Object
Finalize()
Inherited from System.Object
GetHashCode()
Inherited from System.Object
GetType()
Inherited from System.Object
Creates a likelihood function for a specific value of result.
Marginalize(DiscreteConditional<Y>)
Inherited from Cognitoware.Mathematics.Probability.Discrete.DiscreteConditional
Creates a probability distribution of X given a random distribution across Y.
MemberwiseClone()
Inherited from System.Object
Normalizes the distribution so that for each specific value of Y, the sum of probabilities over X sums to one.
Selects the random value of Y that maps to the parameter values.
Maps values of X and Y to a probability value.
ToString()
Inherited from System.Object
Details
A discrete distribution P(XY) that simple maps values of X and Y to a probability value.
The user is responsible for making sure the distribution is normalized.
Constructor Details
public ConditionalValueMap()
Method Details
public override RandomDistribution<Y> BayesianInference(X data, RandomDistribution<Y> belief)
Applies Bayes' Rule to the conditional distribution using a specific value of X.
Parameters:
data
 The observed value of X.
belief
 The prior belief of Y.
Returns:
The probability distribution of Y conditioned on the prior value and the observed data.
public override Double ConditionalProbabilityOf(X x, Y y)
Returns the probability of a specific value result given a specific value range.
Simply looks up the specified values in a dictionary.
Zero is returned if the values do not exist.
Implements the abstract declaration in RandomConditional.
Parameters:
x
 The value whose probability is being calculated.
y
 The value that affects the probability of result.
Returns:
The conditional probability of result given range.
public override RandomDistribution<X> ConditionBy(Y y)
Creates a probability distribution of X given a known y.
A new distribution value map is creating by iterating over all values of X that are mapped to y.
If no condition is defined for y, then an exception is thrown.
Parameters:
y
 The value of Y over which the conditional distribution.
Returns:
The probability of X given the specific value of Y.
public override RandomDistribution<Y> LikelihoodOf(X x)
Creates a likelihood function for a specific value of result.
Iterates over all mapped values to build a new DistributionValueMap.
Parameters:
x
 A conditional value in X.
Returns:
The likelihood of observing values in Y give the value of result.
public override RandomDistribution<X> Marginalize(RandomDistribution<Y> y)
Creates a probability distribution of X given a random distribution across Y.
The probability of a value of X in this distribution is equal to the average conditional
probability of X given Y (defined by this distribution) weighted by the probability
of each corresponding value Y in the parameter distribution.
Iterates over all mapped values to build a new DistributionValueMap.
Parameters:
y

The distribuiton across Y that is used to weight the probability distributions of X.
Returns:
The expectation of X given the probable values of Y.
public void Normalize()
Normalizes the distribution so that for each specific value of Y, the sum of probabilities over X sums to one.
public Y SampleLikelihood(X x, Double p)
Selects the random value of Y that maps to the parameter values.
Parameters:
x
 A value in X.
p
 A likelihood used to select a value of Y.
public void Set(X x, Y y, Double p)
Maps values of X and Y to a probability value.
Parameters:
x
 The value whose probability is being calculated.
y
 The value that affects the probability of result.
p
 The probability of result given range.