56 Real const u = generator.randDblExc();
120 Real const u = generator.randDblExc();
121 return mu +
scale*std::log(u/(1. - u));
133 return std::exp(-z - 2.*std::log1p(std::exp(-z)))/
scale;
144 return -z - 2.*std::log1p(std::exp(-z)) - std::log(
scale);
158 return 0.5*(1. + std::tanh((t -
mu)/(2.*
scale)));
171 if ((p > 1.) || (p < 0.))
176 return mu +
scale*std::log(p/(1. - p));
In this file we define the Logistic probability law class.
In this file we define the utilities constant and method for the Law namespace.
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
virtual Real pdf(Real const &x) const
Real rand() const
Generate a pseudo Logistic random variate.
Real scale_
The scale parameter.
Real mu_
The mu parameter.
Real const & scale() const
virtual Real icdf(Real const &p) const
Compute the inverse cumulative distribution function at p of the standard logistic distribution.
virtual Real cdf(Real const &t) const
Compute the cumulative distribution function at t of the standard logistic distribution.
virtual Real lpdf(Real const &x) const
double Real
STK fundamental type of Real values.
This is the namespace enclosing the classes handling the usual probabilities Laws.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.
static bool isInfinite(Type const &x)
static Type NA()
Adding a Non Available (NA) special number.
static bool isNA(Type const &x)