Click or drag to resize
VariableDiscrete Method (Range, Vector)
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 by a Vector object.

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,
	Vector v
)

Parameters

valueRange
Type: MicrosoftResearch.Infer.ModelsRange
A Range object that is initialized to the number of possible values.
v
Type: MicrosoftResearch.Infer.MathsVector
A Vector object that specifies the probability of each possible value, from [0, probs.Length-1]. The probabilities should sum to 1.0. If not, the probabilities will be normalized.

Return Value

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