Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
|
The general template distribution to be instantiated. More...
#include <templateDistribution.h>
Public Member Functions | |
templateDistribution (int x, double *y, double *z) | |
Constructor for a "xxx" distribution from things and other. The mean is calculated at creation (or not). More... | |
double | mean () |
computing the mathematical expectation or mean More... | |
double | rate () |
computing the "rate", defined as the inverse of the mean More... | |
double | moment (int order) |
Computing the moments of the distribution. More... | |
double | variance () |
Computing 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. More... | |
double | laplace (double s) |
computing the Laplace transform of the distribution at real point More... | |
double | dLaplace (double s) |
computing the derivative of the Laplace transform at real points More... | |
double | cdf (double x) |
computing the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x. More... | |
double | ccdf (double x) |
computing 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. The Distribution class offers a default implementation. More... | |
bool | hasMoment (int order) |
test for the existence of moments of any order More... | |
templateDistribution * | rescale (double factor) |
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). More... | |
templateDistribution * | copy () |
copying a distribution. Typically implemented as rescale(1.0). More... | |
double | sample () |
drawing a (pseudo)random value according to the distribution. More... | |
void | iidSample (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(). More... | |
std::string | toString () |
an utility to convert the distribution into a string. More... | |
void | write (FILE *out, int mode) |
an utility to write the distribution to some file, according to some format. More... | |
templateDistribution (int x, double *y, double *z) | |
Constructor for a "xxx" distribution from things and other. The mean is calculated at creation (or not). More... | |
double | mean () |
computing the mathematical expectation or mean More... | |
double | rate () |
computing the "rate", defined as the inverse of the mean More... | |
double | moment (int order) |
Computing the moments of the distribution. More... | |
double | variance () |
Computing 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. More... | |
double | laplace (double s) |
computing the Laplace transform of the distribution at real point More... | |
double | dLaplace (double s) |
computing the derivative of the Laplace transform at real points More... | |
double | cdf (double x) |
computing the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x. More... | |
double | ccdf (double x) |
computing 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. The Distribution class offers a default implementation. More... | |
bool | hasMoment (int order) |
test for the existence of moments of any order More... | |
templateDistribution * | rescale (double factor) |
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). More... | |
templateDistribution * | copy () |
copying a distribution. Typically implemented as rescale(1.0). More... | |
double | sample () |
drawing a (pseudo)random value according to the distribution. More... | |
void | iidSample (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(). More... | |
std::string | toString () |
an utility to convert the distribution into a string. More... | |
void | write (FILE *out, int mode) |
an utility to write the distribution to some file, according to some format. More... | |
![]() | |
virtual | ~Distribution () |
Standard destructor. More... | |
std::string | name () |
Read accessor to the type name of the distribution. More... | |
double | variance () |
Computing 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. More... | |
double | ccdf (double x) |
computing 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. The Distribution class offers a default implementation. More... | |
void | iidSample (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(). More... | |
virtual double | distanceL1 (Distribution *d) |
Computing generally the L1 distance between distributions. More... | |
virtual bool | hasProperty (std::string pro) |
Property test function. Current properties are: More... | |
void | fprint () |
write on stdout with NORMAL_PRINT_MODE More... | |
virtual | ~Distribution () |
Standard destructor. More... | |
std::string | name () |
Read accessor to the type name of the distribution. More... | |
double | variance () |
Computing 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. More... | |
double | ccdf (double x) |
computing 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. The Distribution class offers a default implementation. More... | |
void | iidSample (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(). More... | |
virtual double | distanceL1 (Distribution *d) |
Computing generally the L1 distance between distributions. More... | |
virtual bool | hasProperty (std::string pro) |
Property test function. Current properties are: More... | |
void | fprint () |
write on stdout with NORMAL_PRINT_MODE More... | |
Additional Inherited Members | |
![]() | |
static double | u_0_1 (void) |
static double | exponential (double mean) |
static double | u_0_1 (void) |
static double | exponential (double mean) |
![]() | |
std::string | _name |
double | _mean |
The general template distribution to be instantiated.
templateDistribution::templateDistribution | ( | int | x, |
double * | y, | ||
double * | z | ||
) |
Constructor for a "xxx" distribution from things and other. The mean is calculated at creation (or not).
x | un truc |
y | un machin |
z | une chose |
templateDistribution::templateDistribution | ( | int | x, |
double * | y, | ||
double * | z | ||
) |
Constructor for a "xxx" distribution from things and other. The mean is calculated at creation (or not).
x | un truc |
y | un machin |
z | une chose |
double templateDistribution::ccdf | ( | double | x | ) |
computing 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. The Distribution class offers a default implementation.
x | the value at which to compute the ccdf |
double templateDistribution::ccdf | ( | double | x | ) |
computing 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. The Distribution class offers a default implementation.
x | the value at which to compute the ccdf |
|
virtual |
computing the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x.
x | the value at which to compute the cdf |
Implements Distribution.
|
virtual |
computing the cumulative distribution function at some real point x. This is the probability that the random variable is less or equal to x.
x | the value at which to compute the cdf |
Computation of the cumulative density function at some real point x
x | value at which the CDF is computed |
Implements Distribution.
|
virtual |
copying a distribution. Typically implemented as rescale(1.0).
Implements Distribution.
|
virtual |
copying a distribution. Typically implemented as rescale(1.0).
Copying the law
Implements Distribution.
|
virtual |
computing the derivative of the Laplace transform at real points
s | the value at which to compute |
Implements Distribution.
|
virtual |
computing the derivative of the Laplace transform at real points
s | the value at which to compute |
Computation of the derivative of the Laplace transform at some real point s
s | value at which the derivative is computed |
Implements Distribution.
|
virtual |
test for the existence of moments of any order
order | the order of the moment to be tested |
Implements Distribution.
|
virtual |
test for the existence of moments of any order
order | the order of the moment to be tested |
Implements Distribution.
void templateDistribution::iidSample | ( | 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().
n | the number of values to sample |
s | an array to be filled with the sample |
void templateDistribution::iidSample | ( | 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().
n | the number of values to sample |
s | an array to be filled with the sample |
Iid samples from the law in a table The result is stored in a table, passed as an argument, that must have been allocated beforehand
nbSamples | number of values to draw |
sequence | the table where the values are stored |
|
virtual |
computing the Laplace transform of the distribution at real point
s | the value at which to compute |
Implements Distribution.
|
virtual |
computing the Laplace transform of the distribution at real point
s | the value at which to compute |
Computation of the Laplace transform at some real point s
s | value at which the derivative is computed |
Implements Distribution.
|
virtual |
|
virtual |
computing the mathematical expectation or mean
Calculation of the mean. Returns the value since it is pre-computed
Implements Distribution.
|
virtual |
Computing the moments of the distribution.
order | the order of the moment to be computed |
Implements Distribution.
|
virtual |
Computing the moments of the distribution.
order | the order of the moment to be computed |
Implements Distribution.
|
virtual |
|
virtual |
computing the "rate", defined as the inverse of the mean
Calculation of the rate, which is the inverse of the mean
Implements Distribution.
|
virtual |
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).
factor | the real factor to be used |
Implements Distribution.
|
virtual |
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).
factor | the real factor to be used |
Rescaling the law X by some real factor f
factor | the factor f |
Implements Distribution.
|
virtual |
drawing a (pseudo)random value according to the distribution.
Implements Distribution.
|
virtual |
drawing a (pseudo)random value according to the distribution.
Sampling from the law This is the straightforward, non optimized, linear-time algorithm
Implements Distribution.
|
virtual |
an utility to convert the distribution into a string.
Implements Distribution.
|
virtual |
an utility to convert the distribution into a string.
Printing a representation of the law into a string
Implements Distribution.
double templateDistribution::variance | ( | ) |
Computing 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 templateDistribution::variance | ( | ) |
Computing 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.
|
virtual |
an utility to write the distribution to some file, according to some format.
out | the file descriptor of the file |
mode | a code for the format to be used |
Implements Distribution.
|
virtual |
an utility to write the distribution to some file, according to some format.
out | the file descriptor of the file |
mode | a code for the format to be used |
Printing a representation of the law
ostream | the output stream |
mode | representation for the output |
Implements Distribution.