Commit b7cf213f authored by Dahua Lin's avatar Dahua Lin

document the probs method

parent 0792898c
......@@ -23,7 +23,7 @@ Changes from v0.5 to v0.6
* Reimplement von Mises-Fisher distribution, making it consistent with the common interface ([#302])
* Reimplement mixture models, improving efficiency, numerical stability, and the friendliness of the user interface. ([#303])
* Reimplement Wishart and InverseWishart distributions. They now support the use of positive definite matrices of arbitrary subtype of `AbstractPDMat`. ([#304])
* Add ``probs`` method for ``Categorical``, ``Multinomial``, and ``MixtureModel``.
* Add ``probs`` methods for discrete distributions ([#305]).
[#238]: https://github.com/JuliaStats/Distributions.jl/pull/238
[#223]: https://github.com/JuliaStats/Distributions.jl/pull/223
......@@ -39,4 +39,6 @@ Changes from v0.5 to v0.6
[#302]: https://github.com/JuliaStats/Distributions.jl/pull/302
[#303]: https://github.com/JuliaStats/Distributions.jl/pull/303
[#304]: https://github.com/JuliaStats/Distributions.jl/pull/304
[#305]: https://github.com/JuliaStats/Distributions.jl/pull/305
......@@ -91,6 +91,19 @@ Probability Evaluation
When ``x`` is a scalar, it returns whether x is within the support of ``d``.
When ``x`` is an array, it returns whether every element in x is within the support of ``d``.
.. function:: probs(d, rgn)
Get/compute the probabilities over a range of values. Here, ``rgn`` should be in the form of ``a:b``.
**Note:** computing the probabilities over a contiguous range of values can take advantage of the recursive relations between probability masses and thus is often more efficient than computing these probabilities individually.
.. function:: probs(d)
Get/compute the entire probability vector of ``d``. This is equivalent to ``probs(d, minimum(d):maximum(d))``.
**Note:** this method is only defined for *bounded* distributions.
.. function:: pdf(d, x)
The pdf value(s) evaluated at ``x``.
......@@ -99,7 +112,7 @@ Probability Evaluation
The logarithm of the pdf value(s) evaluated at x, i.e. ``log(pdf(x))``.
**Node:** The internal implementation may directly evaluate logpdf instead of first computing pdf and then taking the logarithm, for better numerical stability or efficiency.
**Note:** The internal implementation may directly evaluate logpdf instead of first computing pdf and then taking the logarithm, for better numerical stability or efficiency.
.. function:: loglikelihood(d, x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment