Frames No Frames Cognitoware API v2009512
Cognitoware.Robotics.dll

Class MixedDistribution<T>
T: The type of the values predicted by the distribution.

System.Object
Cognitoware.Mathematics.Probability.RandomDistribution<T>
Cognitoware.Mathematics.Probability.MixedDistribution<T>

## Summary

A RandomDistribution whose probability values are calculated from the weighted average of other distributions.

## Method Summary

Adds a new distribution and weight to the mixed distribution.
AliasAs()
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
Equals(Object)
Inherited from System.Object
Finalize()
Inherited from System.Object
GetEntropy(IEnumerable<T>)
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
GetHashCode()
Inherited from System.Object
GetType()
Inherited from System.Object
MemberwiseClone()
Inherited from System.Object
Normalizes the weights of the mixed distribution.
Returns the probability of a specific value of T.
Sample(Random)
Not implemented in MixedDistribuion.
ToString()
Inherited from System.Object

## Details

A RandomDistribution whose probability values are calculated from the weighted average of other distributions. The user is responsible for ensuring that the weights are normalized.

## Constructor Details

public MixedDistribution()

## Method Details

public void Add(RandomDistribution<T> p, Double weight)
Adds a new distribution and weight to the mixed distribution.

### Parameters:

`p` - The distribution to mix.
`weight` - The weight of the distribution.

public void Normalize()
Traverses all of the distributions to sum the weights, then traverses them all again to divide all of the weights by the total weight sum.

public override Double ProbabilityOf(T t)
Returns the probability of a specific value of T. The probability of t is retrieved for each contained distribution and multiplied by the associated weight. The sum of these products is returned.

### Parameters:

`t` - The value whose probability is returned.

### Returns:

The probability of t.

public override T Sample(Random select)
This implementation throws NotImplementedException.