35#ifndef STK_LAW_BERNOULLI_H
36#define STK_LAW_BERNOULLI_H
163{
return (
t<0.) ? 0. : (
t<1.) ? 1.-
prob_ : 1.;}
166#ifdef STK_STATISTIK_DEBUG
176#ifdef STK_STATISTIK_DEBUG
185#ifdef STK_STATISTIK_DEBUG
199#ifdef STK_STATISTIK_DEBUG
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.
Bernoulli probability law.
Bernoulli(Real const &prob=0.5)
constructor
virtual Binary rand() const
virtual Binary icdf(Real const &prob) const
inverse cumulative distribution function The quantile is defined as the smallest value x such that F...
virtual Real cdf(Real const &t) const
compute the cumulative distribution function Give the probability that a Bernoulli random variate is ...
virtual Real pdf(Binary const &x) const
compute the probability distribution function (density) Give the value of the pdf at the point x.
Real prob_
probability of success in a Bernoulli trial
Real const & prob() const
virtual Real lpdf(Binary const &x) const
compute the log probability distribution function Give the value of the log-pdf at the point x.
virtual ~Bernoulli()
destructor
void setProb(Real const &prob)
Interface base class for all the univariate distributions.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Binary
STK fundamental type of a binary.
std::basic_string< Char > String
STK fundamental type of a String.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.
static Type NA()
Adding a Non Available (NA) special number.