Skip to content

Commit 9b28d57

Browse files
committed
more doc tweaks
1 parent cab4cfb commit 9b28d57

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/data_utils.jl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,11 @@ _squeeze(v) = first(v)
296296

297297
const UNIVARIATE_FINITE_DOCSTRING =
298298
"""
299-
UnivariateFinite(support, probs; pool=nothing, ordered=false)
299+
UnivariateFinite(support,
300+
probs;
301+
pool=nothing,
302+
augmented=false,
303+
ordered=false)
300304
301305
Construct a discrete univariate distribution whose finite support is
302306
the elements of the vector `support`, and whose corresponding
@@ -307,15 +311,24 @@ generated.
307311
308312
Unless `pool` is specified, `support` should have type
309313
`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`.
311315
312316
*Important.* All levels of the common pool have associated
313317
probabilites, not just those in the specified `support`. However,
314318
these probabilities are always zero (see example below).
315319
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`.
319332
320333
```
321334
using CategoricalArrays

0 commit comments

Comments
 (0)