35#ifndef STK_LAW_POISSON_H
36#define STK_LAW_POISSON_H
91 virtual int rand()
const;
97 virtual Real pdf(
int const& x)
const;
103 virtual Real lpdf(
int const& x)
const;
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.
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...
Poisson distribution law.
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
void setLambda(Real const &lambda)
Real const & lambda() const
virtual int icdf(Real const &p) const
inverse cumulative distribution function The quantile is defined as the smallest value q such that F...
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 ~Poisson()
destructor
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.