@@ -323,6 +323,14 @@ construct an abstract *array* of `UnivariateFinite` distributions by
323
323
choosing `probs` to be an array of one higher dimension than the array
324
324
generated.
325
325
326
+ Here the word "probabilities" is an abuse of terminology as there is
327
+ no requirement that probabilities actually sum to one, only that they
328
+ be non-negative. So `UnivariateFinite` objects actually implement
329
+ arbitrary non-negative measures over finite sets of labelled points. A
330
+ `UnivariateDistribution` will be a bona fide probability measure when
331
+ constructed using the `augment=true` option (see below) or when
332
+ `fit` to data.
333
+
326
334
Unless `pool` is specified, `support` should have type
327
335
`AbstractVector{<:CategoricalValue}` and all elements are assumed to
328
336
share the same categorical pool, which may be larger than `support`.
@@ -335,7 +343,8 @@ If `probs` is a matrix, it should have a column for each class in
335
343
`support` (or one less, if `augment=true`). More generally, `probs`
336
344
will be an array whose size is of the form `(n1, n2, ..., nk, c)`,
337
345
where `c = length(support)` (or one less, if `augment=true`) and the
338
- constructor then returns an array of size `(n1, n2, ..., nk)`.
346
+ constructor then returns an array of `UnivariateFinite` distributions
347
+ of size `(n1, n2, ..., nk)`.
339
348
340
349
```
341
350
using CategoricalArrays
@@ -401,11 +410,12 @@ julia> UnivariateFinite([:x, :y, :z], probs, pool=v)
401
410
402
411
### Probability augmentation
403
412
404
- Unless `augment=true`, sums of elements along the last axis (row-sums
405
- in the case of a matrix) must be equal to one, and otherwise such an
406
- array is created by inserting appropriate elements *ahead* of those
407
- provided. This means the provided probabilities are associated with
408
- the the classes `c2, c3, ..., cn`.
413
+ If `augment=true` the provided array is augmented by inserting
414
+ appropriate elements *ahead* of those provided, along the last
415
+ dimension of the array. This means the user only provides probabilities
416
+ for the classes `c2, c3, ..., cn`. The class `c1` probabilities are
417
+ chosen so that each `UnivariateFinite` distribution in the returned
418
+ array is a bona fide probability distribution.
409
419
410
420
---
411
421
0 commit comments