@@ -318,7 +318,7 @@ const UNIVARIATE_FINITE_DOCSTRING =
318
318
319
319
Construct a discrete univariate distribution whose finite support is
320
320
the elements of the vector `support`, and whose corresponding
321
- probabilities are elements of the vector `probs`. More generally ,
321
+ probabilities are elements of the vector `probs`. Alternatively ,
322
322
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.
@@ -328,13 +328,13 @@ Unless `pool` is specified, `support` should have type
328
328
share the same categorical pool, which may be larger than `support`.
329
329
330
330
*Important.* All levels of the common pool have associated
331
- probabilites , not just those in the specified `support`. However,
331
+ probabilities , not just those in the specified `support`. However,
332
332
these probabilities are always zero (see example below).
333
333
334
334
If `probs` is a matrix, it should have a column for each class in
335
335
`support` (or one less, if `augment=true`). More generally, `probs`
336
336
will be an array whose size is of the form `(n1, n2, ..., nk, c)`,
337
- where `c = length(suppport )` (or one less, if `augment=true`) and the
337
+ where `c = length(support )` (or one less, if `augment=true`) and the
338
338
constructor then returns an array of size `(n1, n2, ..., nk)`.
339
339
340
340
```
@@ -345,7 +345,7 @@ julia> UnivariateFinite(classes(v), [0.2, 0.3, 0.5])
345
345
UnivariateFinite{Multiclass{3}}(x=>0.2, y=>0.3, z=>0.5)
346
346
347
347
julia> d = UnivariateFinite([v[1], v[end]], [0.1, 0.9])
348
- UnivariateFiniteMulticlass {3}(x=>0.1, z=>0.9)
348
+ UnivariateFinite{Multiclass {3}(x=>0.1, z=>0.9)
349
349
350
350
julia> rand(d, 3)
351
351
3-element Array{Any,1}:
@@ -416,10 +416,13 @@ the set of keys of the provided dictionary, `prob_given_class`, and
416
416
whose values specify the corresponding probabilities.
417
417
418
418
The type requirements on the keys of the dictionary are the same as
419
- the elements of `support` given above. If the values (probabilities)
420
- are arrays instead of scalars, then an abstract array of
421
- `UnivariateFinite` elements is created, with the same size as the
422
- array.
419
+ the elements of `support` given above with this exception: if
420
+ non-categorical elements (raw labels) are used as keys, then
421
+ `pool=...` must be specified and cannot be `missing`.
422
+
423
+ If the values (probabilities) are arrays instead of scalars, then an
424
+ abstract array of `UnivariateFinite` elements is created, with the
425
+ same size as the array.
423
426
424
427
"""
425
428
UNIVARIATE_FINITE_DOCSTRING
0 commit comments