Skip to content

Latest commit

 

History

History
202 lines (133 loc) · 4.19 KB

binomial.rst

File metadata and controls

202 lines (133 loc) · 4.19 KB

Binomial Distribution

Table of contents


The density function of the Binomial distribution:

f(x; n, p) = \binom{n}{x} p^x (1-p)^{n-x} \times \mathbf{1}[x \in \{0,\ldots,n\}]

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: dbinom(const llint_t, const llint_t, const T, const bool)
   :project: statslib

.. doxygenfunction:: dbinom(const std::vector<eT>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: dbinom(const ArmaMat<eT>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: dbinom(const BlazeMat<eT, To>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: dbinom(const EigenMat<eT, iTr, iTc>&, const llint_t, const T1, const bool)
   :project: statslib


The cumulative distribution function of the Binomial distribution:

F(x; n, p) = \sum_{z \leq x} f(z; n, p)

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: pbinom(const llint_t, const llint_t, const T, const bool)
   :project: statslib

.. doxygenfunction:: pbinom(const std::vector<eT>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: pbinom(const ArmaMat<eT>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: pbinom(const BlazeMat<eT, To>&, const llint_t, const T1, const bool)
   :project: statslib

.. doxygenfunction:: pbinom(const EigenMat<eT, iTr, iTc>&, const llint_t, const T1, const bool)
   :project: statslib


The quantile function of the Binomial distribution:

q(r; n, p) = \inf \left\{ x : r \leq F(x; n, p) \right\}

Methods for scalar input, as well as for vector/matrix input, are listed below.

.. doxygenfunction:: qbinom(const T1, const llint_t, const T2)
   :project: statslib

.. doxygenfunction:: qbinom(const std::vector<eT>&, const llint_t, const T1)
   :project: statslib

.. doxygenfunction:: qbinom(const ArmaMat<eT>&, const llint_t, const T1)
   :project: statslib

.. doxygenfunction:: qbinom(const BlazeMat<eT, To>&, const llint_t, const T1)
   :project: statslib

.. doxygenfunction:: qbinom(const EigenMat<eT, iTr, iTc>&, const llint_t, const T1)
   :project: statslib


Random sampling for the Binomial distribution is achieved by summing the results of simulating n Bernoulli-distributed random variables.

  1. Random number engines
.. doxygenfunction:: rbinom(const llint_t, const T, rand_engine_t&)
   :project: statslib

  1. Seed values
.. doxygenfunction:: rbinom(const llint_t, const T, const ullint_t)
   :project: statslib

  1. Random number engines
.. doxygenfunction:: rbinom(const ullint_t, const ullint_t, const llint_t, const T1, rand_engine_t&)
   :project: statslib

  1. Seed values
.. doxygenfunction:: rbinom(const ullint_t, const ullint_t, const llint_t, const T1, const ullint_t)
   :project: statslib