GammaDistribution Class Reference
marmote
marmoteCore is a C++ API dedicated to modeling with Markov chains.
|
The Gamma distribution with two parameters: shape and scale. More...
#include <marmoteGammaDistribution.h>

Public Member Functions | |
GammaDistribution (double shape, double scale) | |
Constructor for the Gamma distribution from its shape and scale parameters. The mean is calculated at creation. | |
double | shape () |
double | rate () |
double | scale () |
double | Mean () const override |
computing the mathematical expectation or mean | |
double | Rate () const override |
Computation of the "rate", defined as the inverse of the mean. | |
double | Moment (int order) const override |
double | Variance () const override |
Computation of the variance of the random variable: the second moment minus the square of the first moment. Variance is the square of the coefficient of variation. The Distribution class offers a default implementation. | |
double | Laplace (double s) const override |
Computation of the Laplace transform of the distribution at real point. | |
double | DLaplace (double s) const override |
Computation of the derivative of the Laplace transform at real points. | |
double | Cdf (double x) const override |
Computation of the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x. | |
bool | HasMoment (int) const override |
Test for the existence of moments of any order. | |
GammaDistribution * | Rescale (double factor) const override |
Rescaling a distribution by some real factor. Not all distributions allow this for any real factor. If the operation fails, or if the factor is 1.0, a copy of the distribution should be returned (not by using the Copy() function). | |
virtual GammaDistribution * | Copy () const override |
Copying a distribution. Implemented by default as Rescale(1.0). | |
double | Sample () override |
drawing a (pseudo)random value according to the distribution. | |
void | Write (std::ostream *out, inoutFormat format) const override |
Utility to write the a representation of the distribution to some stream, according to some format. | |
![]() | |
Distribution ()=default | |
Standard constructor. | |
virtual | ~Distribution ()=default |
Standard destructor. | |
std::string | name () |
Accessor to the type name of the distribution. | |
virtual double | Ccdf (double x) const |
Computation of the complementary cumulative distributon function (or tail) at some real point x. This is the probability that the random variable is strictly larger than x. | |
virtual void | IidSample (unsigned long int n, double *s) |
drawing an i.i.d. sample from the distribution. The result is returned in an array (that must have been already allocated) passed as a parameter. The Distribution class offers the default implementation with repeated call to sample(). | |
virtual bool | HasProperty (std::string pro) const |
Property test function. Current properties are: | |
virtual std::string | toString (inoutFormat format) const |
Utility to convert the distribution into a string. | |
void | fprint () const |
write on standard output with the standard marmote format | |
std::string | toString (void) const |
![]() | |
Object (void) | |
virtual | ~Object (void) |
const std::string & | className (void) const |
void | setClassName (const std::string &) |
std::string | toString (void) const |
std::string | content (void) const |
std::string | info (void) const |
Protected Member Functions | |
std::string | content_impl (void) const override |
std::string | info_impl (void) const override |
![]() | |
std::string | toString_impl (void) const override |
Protected Attributes | |
double | shape_ |
double | rate_ |
double | scale_ |
![]() | |
std::string | name_ |
double | mean_ = 0.0 |
Additional Inherited Members | |
![]() | |
static double | Distance (distType type, Distribution *d1, Distribution *d2) |
Computing generally some distance between two distributions. | |
static double | DistanceL1 (Distribution *d1, Distribution *d2) |
Computing generally the L1 distance between two distributions. | |
static double | DistanceL2 (Distribution *d1, Distribution *d2) |
Computing generally the L2 distance between two distributions. | |
static double | DistanceLInfinity (Distribution *d1, Distribution *d2) |
Computing generally the L-infinity distance between two distributions. | |
static double | DistanceTV (Distribution *d1, Distribution *d2) |
Computing generally the total variation distance between two distributions. | |
static double | U_0_1 (void) |
static double | Exponential (double Mean) |
![]() | |
static const double | VALUE_TOLERANCE = 1.0e-8 |
static const double | VALUE_SUMPROBAS = 1.0e-10 |
static const std::string | distance_name [4] = { "L1", "L2", "L-infinity", "TV" } |
Detailed Description
The Gamma distribution with two parameters: shape and scale.
Constructor & Destructor Documentation
◆ GammaDistribution()
GammaDistribution::GammaDistribution | ( | double | shape, |
double | scale ) |
Constructor for the Gamma distribution from its shape and scale parameters. The mean is calculated at creation.
- Parameters
-
shape the shape parameter scale the rate parameter
Member Function Documentation
◆ Cdf()
|
overridevirtual |
Computation of the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x.
- Parameters
-
x the value at which to compute the cdf
- Returns
- the value of the cdf
Implements Distribution.
◆ content_impl()
|
overrideprotectedvirtual |
Reimplemented from marmote::Object.
◆ Copy()
|
overridevirtual |
Copying a distribution. Implemented by default as Rescale(1.0).
- See also
- Rescale(double)
- Returns
- a copy of the distribution
Reimplemented from Distribution.
Reimplemented in ErlangDistribution, and ExponentialDistribution.
◆ DLaplace()
|
overridevirtual |
Computation of the derivative of the Laplace transform at real points.
- Parameters
-
s the value at which to compute
- Returns
- the value of the derivative of the Laplace transform: d LT(s)/ds
Implements Distribution.
◆ HasMoment()
|
overridevirtual |
Test for the existence of moments of any order.
- Parameters
-
order the order of the moment to be tested
- Returns
- true if the moment exists, false otherwise
Implements Distribution.
◆ info_impl()
|
overrideprotectedvirtual |
Reimplemented from marmote::Object.
◆ Laplace()
|
overridevirtual |
Computation of the Laplace transform of the distribution at real point.
- Parameters
-
s the value at which to compute
- Returns
- the value of the Laplace transform: LT(s)
Implements Distribution.
◆ Mean()
|
overridevirtual |
◆ Moment()
|
overridevirtual |
These distributions always have a moment.
Implements Distribution.
◆ Rate()
|
overridevirtual |
Computation of the "rate", defined as the inverse of the mean.
- Returns
- the rate
Implements Distribution.
◆ rate()
|
inline |
◆ Rescale()
|
overridevirtual |
Rescaling a distribution by some real factor. Not all distributions allow this for any real factor. If the operation fails, or if the factor is 1.0, a copy of the distribution should be returned (not by using the Copy() function).
- See also
- Copy()
- Parameters
-
factor the real factor to be used, f
- Returns
- a new distribution object, the distribution of f.X
Implements Distribution.
◆ Sample()
|
overridevirtual |
drawing a (pseudo)random value according to the distribution.
- Returns
- a sample
Implements Distribution.
◆ scale()
|
inline |
◆ shape()
|
inline |
◆ Variance()
|
overridevirtual |
Computation of the variance of the random variable: the second moment minus the square of the first moment. Variance is the square of the coefficient of variation. The Distribution class offers a default implementation.
- Returns
- the variance
Reimplemented from Distribution.
◆ Write()
|
overridevirtual |
Utility to write the a representation of the distribution to some stream, according to some format.
- Parameters
-
out the descriptor of the stream on which to write format a code for the output format to be used
Implements Distribution.
Field Documentation
◆ rate_
|
protected |
rate parameter "beta" of the distribution
◆ scale_
|
protected |
scale parameter "theta" of the distribution
◆ shape_
|
protected |
shape parameter "k" of the distribution
The documentation for this class was generated from the following files:
- src/marmoteCore/marmoteGammaDistribution.h
- src/marmoteCore/marmoteGammaDistribution.cpp