9.3 Finite Distribution Families
9.3.1 Unordered Discrete Distributions
syntax
(Discrete-Dist A)
procedure
(discrete-dist xs) → (Discrete-Dist A)
xs : (Sequenceof A) (discrete-dist xs ws) → (Discrete-Dist A) xs : (Sequenceof A) ws : (Sequenceof Real)
procedure
(discrete-dist-values d) → (Listof A)
d : (Discrete-Dist A)
procedure
(discrete-dist-probs d) → (Listof Positive-Flonum)
d : (Discrete-Dist A)
Represents families of unordered, discrete distributions over values of type A, with equality
decided by equal?.
The weights in ws must be nonnegative, and are treated as unnormalized probabilities. When ws is not given, the values in xs are assigned uniform probabilities.
The type (Discrete-Dist A) is a subtype of (dist A A). This means that discrete distribution objects are unordered, and thus have only a pdf and a procedure to generate random samples.
Examples: | |||||||||||||||||||||
|