Click or drag to resize
VariableDiscrete Method (Range, VariableVector)
Microsoft Research
Creates a random variable that is statistically defined by a Discrete distribution with the number of possible values specified by a Range object and the probabilities of the possible values specified by an Vector random variable.

Namespace: MicrosoftResearch.Infer.Models
Assembly: Infer.Compiler (in Infer.Compiler.dll) Version: 2.6.41128.1 (2.6.41128.1)
Syntax
public static Variable<int> Discrete(
	Range valueRange,
	Variable<Vector> probs
)

Parameters

valueRange
Type: MicrosoftResearch.Infer.ModelsRange
A range defining the possible values for the variable.
probs
Type: MicrosoftResearch.Infer.ModelsVariableVector
A variable holding the set of probabilities of having each value. Must add up to one.

Return Value

Type: VariableInt32
Returns a random variable that is statistically defined by the specified Discrete distribution.
See Also