1 #ifndef STAT_BernoulliDistribution_H
2 #define STAT_BernoulliDistribution_H
9 #include <boost/math/distributions/bernoulli.hpp>
10 #include <boost/random/bernoulli_distribution.hpp>
11 #include <boost/random/variate_generator.hpp>
31 boost::math::bernoulli_distribution<tReal> *mDistribution;
32 boost::random::bernoulli_distribution<tReal> *mRandomDistribution;
33 boost::random::variate_generator<
RNGType&,
34 boost::random::bernoulli_distribution<tReal> > *mGenerator;
61 inline static SP::STAT_BernoulliDistribution
New(
const tReal& p) {
64 ptr->setProperties(p);
70 inline static SP::STAT_BernoulliDistribution
New() {
virtual tReal standardDeviation() const
compute the standard deviation
Definition: STAT_BernoulliDistribution.cpp:73
STAT_BernoulliDistribution()
create an object
Definition: STAT_BernoulliDistribution.cpp:4
virtual tReal computeGrowthRate()
return the growth rate of the distribution such that Esperance(E(exp(-z*X)))=0.5
Definition: STAT_Distribution.h:133
virtual void range(tReal &xmin, tReal &xmax) const
compute the range of the distribution
Definition: STAT_BernoulliDistribution.cpp:38
virtual SP::STAT_Distribution NewInstance() const
create a new instance of the distribution
Definition: STAT_BernoulliDistribution.h:75
virtual tReal random() const
random return a random numbers
Definition: STAT_BernoulliDistribution.cpp:78
virtual tReal mean() const =0
compute the mean
#define tBoolean
Definition: types.h:48
virtual void computeSample(const int &n, CORE_RealArray &sample) const
compute a sample of size n
Definition: STAT_BernoulliDistribution.cpp:85
virtual tReal pdf(const tReal &x) const
compute the probability density function at x point
Definition: STAT_BernoulliDistribution.cpp:46
virtual ~STAT_BernoulliDistribution(void)
destroy an object.
Definition: STAT_BernoulliDistribution.cpp:13
virtual tReal variance() const
compute the variance
Definition: STAT_BernoulliDistribution.cpp:68
this class describes an array
Definition: CORE_Array.h:18
virtual tReal cdfc(const tReal &x) const
compute the cumulative distribution complement function at x point
Definition: STAT_BernoulliDistribution.cpp:57
This class is the class to describes general distribution.
Definition: STAT_Distribution.h:25
This class is the class to describes Bernoulli distribution.
Definition: STAT_BernoulliDistribution.h:20
boost::mt19937 RNGType
Definition: STAT_Distribution.h:23
static SP::STAT_BernoulliDistribution New(const tReal &p)
create a Bernoulli distibution
Definition: STAT_BernoulliDistribution.h:61
static SP::STAT_BernoulliDistribution New()
create a Bernoulli distibution
Definition: STAT_BernoulliDistribution.h:70
virtual tReal mean() const
compute the mean
Definition: STAT_BernoulliDistribution.cpp:63
#define tReal
Definition: types.h:18
virtual tReal cdf(const tReal &x) const
compute the cumulative distribution function at x point
Definition: STAT_BernoulliDistribution.cpp:51
void setProperties(const tReal &p)
Definition: STAT_BernoulliDistribution.cpp:22
DEFINE_SPTR(STAT_BernoulliDistribution)
virtual void copy(const STAT_Distribution &d)
copy the distribution
Definition: STAT_BernoulliDistribution.h:82
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106