35#ifndef STK_LAW_NEGATIVEBINOMIAL_H
36#define STK_LAW_NEGATIVEBINOMIAL_H
198GetRNGstate();
int s = Rf_rnbinom(
size,
prob); PutRNGstate();
return s;
202{
return Rf_dnbinom((
double)x,
size,
prob,
false);}
204{
return Rf_dnbinom((
double)x,
size,
prob,
true);}
206{
return Rf_pnbinom(t,
size,
prob ,
true,
false);}
208{
return (
int)::Rf_qnbinom(p,
size,
prob ,
true,
false);}
In this file we define the interface base class IUnivLaw for all probabilities laws.
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
#define _T(x)
Let x unmodified.
Interface base class for all the univariate distributions.
virtual Real cdfc(Real const &t) const
calculate the complement of cumulative distribution function, called in statistics the survival funct...
virtual Real lcdfc(Real const &t) const
calculate the log-complement of cumulative distribution function Give the log-probability that a rand...
virtual Real lcdf(Real const &t) const
compute the lower tail log-cumulative distribution function Give the log-probability that a random va...
NegativeBinomial probability law.
void setProb(Real const &prob)
virtual ~NegativeBinomial()
destructor
Real const & prob() const
virtual Real cdf(Real const &t) const
compute the cumulative distribution function Give the probability that a NegativeBinomial random vari...
NegativeBinomial(int size=1, Real const &prob=0.5)
constructor
virtual Integer rand() const
virtual Real lpdf(Integer const &x) const
compute the log probability distribution function Give the value of the log-pdf at the point x.
int size_
number of successes
virtual Real pdf(Integer const &x) const
compute the probability distribution function (density) Give the value of the pdf at the point x.
virtual Integer icdf(Real const &p) const
inverse cumulative distribution function The quantile is defined as the smallest value x such that F...
void setSize(Integer size)
Real prob_
probability of success in a Bernoulli trial
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
int Integer
STK fundamental type of integer values.
The namespace STK is the main domain space of the Statistical ToolKit project.