@@ -296,7 +296,11 @@ _squeeze(v) = first(v)
296
296
297
297
const UNIVARIATE_FINITE_DOCSTRING =
298
298
"""
299
- UnivariateFinite(support, probs; pool=nothing, ordered=false)
299
+ UnivariateFinite(support,
300
+ probs;
301
+ pool=nothing,
302
+ augmented=false,
303
+ ordered=false)
300
304
301
305
Construct a discrete univariate distribution whose finite support is
302
306
the elements of the vector `support`, and whose corresponding
@@ -307,15 +311,24 @@ generated.
307
311
308
312
Unless `pool` is specified, `support` should have type
309
313
`AbstractVector{<:CategoricalValue}` and all elements are assumed to
310
- share the same categorical pool.
314
+ share the same categorical pool, which may be larger than `support` .
311
315
312
316
*Important.* All levels of the common pool have associated
313
317
probabilites, not just those in the specified `support`. However,
314
318
these probabilities are always zero (see example below).
315
319
316
- If `probs` has size `(C, n1, n2, ..., nk)` then an array of size `(n1,
317
- n2, ..., nk)` is created. In all cases elements along the first axis
318
- always sum to one.
320
+ If `probs` is a matrix, it should have a column for each class in
321
+ `support` (or one less, if `augment=true`). More generally, `probs`
322
+ will be an array of size of the form `(n1, n2, ..., nk, C)` where `C`
323
+ is the number of classes (or one less, if `augment=true`), the
324
+ constructor returning an array of size `(n1, n2, ..., nk)`.
325
+
326
+ Unless `augment=true`, sums of elements along the last axis (row-sums
327
+ in the case of a matrix) must be equal to one, and otherwise such an
328
+ array is created by inserting appropriate elements *ahead* of those
329
+ provided. For example, in the binary case, augmentation will transform
330
+ a vector into a matrix, and the given probabilities will be associated
331
+ with the *second* class in `support`.
319
332
320
333
```
321
334
using CategoricalArrays
0 commit comments