35#ifndef STK_LAW_POISSON_H
36#define STK_LAW_POISSON_H
97 virtual Real pdf(
int const& x)
const;
103 virtual Real lpdf(
int const& x)
const;
117 virtual int icdf(
Real const& p)
const;
175 GetRNGstate();
int s = (
int)Rf_rpois(
lambda_); PutRNGstate();
return s;
192 GetRNGstate();
int s = (int)Rf_rpois(
lambda); PutRNGstate();
return s;
196{
return Rf_dpois((
double)x,
lambda,
false);}
198{
return Rf_dpois((
double)x,
lambda,
true);}
200{
return Rf_ppois(t,
lambda,
true,
false);}
202{
return (
int)Rf_qpois(p,
lambda,
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.
virtual Real cdfc(Real const &t) const
virtual Real lcdfc(Real const &t) const
virtual Real lcdf(Real const &t) const
IUnivLaw(String const &name)
virtual Real cdf(Real const &t) const
compute the cumulative distribution function Give the probability that a Poisson random variate is le...
Real lambda_
mean of the Poisson distribution
Poisson(Real const &lambda=1.)
constructor
virtual Integer rand() const
void setLambda(Real const &lambda)
Real const & lambda() const
virtual Real lpdf(int const &x) const
compute the log probability distribution function.
virtual Real pdf(int const &x) const
compute the probability distribution function.
virtual int icdf(Real const &p) const
inverse cumulative distribution function The quantile is defined as the smallest value q such that F...
virtual ~Poisson()
destructor
double Real
STK fundamental type of Real values.
int Integer
STK fundamental type of integer values.
This is the namespace enclosing the classes handling the usual probabilities Laws.
The namespace STK is the main domain space of the Statistical ToolKit project.