The negative binomial distribution is an integer valued distribution with two parameters, k
and p
.
More...
#include <negative_binomial_distribution.hpp>
Classes | |
class | param_type |
Public Types | |
typedef IntType | result_type |
typedef RealType | input_type |
Public Member Functions | |
negative_binomial_distribution (IntType k_arg=1, RealType p_arg=RealType(0.5)) | |
Construct a negative_binomial_distribution object. More... | |
negative_binomial_distribution (const param_type &parm) | |
Construct an negative_binomial_distribution object from the parameters. More... | |
template<class URNG > | |
IntType | operator() (URNG &urng) const |
Returns a random variate distributed according to the negative binomial distribution. More... | |
template<class URNG > | |
IntType | operator() (URNG &urng, const param_type &parm) const |
Returns a random variate distributed according to the negative binomial distribution with parameters specified by param . More... | |
IntType | k () const |
Returns the k parameter of the distribution. More... | |
RealType | p () const |
Returns the p parameter of the distribution. More... | |
IntType min | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the smallest value that the distribution can produce. More... | |
IntType max | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the largest value that the distribution can produce. More... | |
param_type | param () const |
Returns the parameters of the distribution. More... | |
void | param (const param_type &parm) |
Sets parameters of the distribution. More... | |
void | reset () |
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset. More... | |
Friends | |
template<class CharT , class Traits > | |
std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, const negative_binomial_distribution &bd) |
Writes the parameters of the distribution to a std::ostream . More... | |
template<class CharT , class Traits > | |
std::basic_istream< CharT, Traits > & | operator>> (std::basic_istream< CharT, Traits > &is, negative_binomial_distribution &bd) |
Reads the parameters of the distribution from a std::istream . More... | |
bool | operator== (const negative_binomial_distribution &lhs, const negative_binomial_distribution &rhs) |
Returns true if the two distributions will produce the same sequence of values, given equal generators. More... | |
bool | operator!= (const negative_binomial_distribution &lhs, const negative_binomial_distribution &rhs) |
Returns true if the two distributions could produce different sequences of values, given equal generators. More... | |
The negative binomial distribution is an integer valued distribution with two parameters, k
and p
.
The distribution produces non-negative values.
The distribution function is .
This implementation uses a gamma-poisson mixture.
typedef RealType boost::random::negative_binomial_distribution< IntType, RealType >::input_type |
typedef IntType boost::random::negative_binomial_distribution< IntType, RealType >::result_type |
|
inlineexplicit |
Construct a negative_binomial_distribution
object.
k
and p
are the parameters of the distribution.
Requires: k >=0 && 0 <= p <= 1
Referenced by boost::random::negative_binomial_distribution< IntType, RealType >::operator()().
|
inlineexplicit |
Construct an negative_binomial_distribution
object from the parameters.
|
inline |
Returns the smallest value that the distribution can produce.
|
inline |
Returns the largest value that the distribution can produce.
References boost::accumulators::extract::max.
|
inline |
Returns the k
parameter of the distribution.
References boost::phoenix::local_names::_k.
|
inline |
Returns a random variate distributed according to the negative binomial distribution.
References boost::phoenix::local_names::_k, and boost::phoenix::local_names::_p.
|
inline |
Returns a random variate distributed according to the negative binomial distribution with parameters specified by param
.
References boost::random::negative_binomial_distribution< IntType, RealType >::negative_binomial_distribution().
|
inline |
Returns the p
parameter of the distribution.
References boost::phoenix::local_names::_p.
|
inline |
Returns the parameters of the distribution.
References boost::phoenix::local_names::_k, and boost::phoenix::local_names::_p.
|
inline |
Sets parameters of the distribution.
References boost::phoenix::local_names::_k, boost::phoenix::local_names::_p, boost::random::negative_binomial_distribution< IntType, RealType >::param_type::k(), and boost::random::negative_binomial_distribution< IntType, RealType >::param_type::p().
|
inline |
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
|
friend |
Returns true if the two distributions could produce different sequences of values, given equal generators.
|
friend |
Writes the parameters of the distribution to a std::ostream
.
|
friend |
Returns true if the two distributions will produce the same sequence of values, given equal generators.
|
friend |
Reads the parameters of the distribution from a std::istream
.