38#include "../include/STK_Law_Normal.h"
41const double a1 = -39.69683028665376;
42const double a2 = 220.9460984245205;
43const double a3 = -275.9285104469687;
44const double a4 = 138.3577518672690;
45const double a5 =-30.66479806614716;
46const double a6 = 2.506628277459239;
48const double b1 = -54.47609879822406;
49const double b2 = 161.5858368580409;
50const double b3 = -155.6989798598866;
51const double b4 = 66.80131188771972;
52const double b5 = -13.28068155288572;
54const double c1 = -0.007784894002430293;
55const double c2 = -0.3223964580411365;
56const double c3 = -2.400758277161838;
57const double c4 = -2.549732539343734;
58const double c5 = 4.374664141464968;
59const double c6 = 2.938163982698783;
61const double d1 = 0.007784695709041462;
62const double d2 = 0.3224671290700398;
63const double d3 = 2.445134137142996;
64const double d4 = 3.754408661907416;
90 if (
sigma_ == 0.)
return (x==
mu_) ? 1. : 0.;
93 return Const::_1_SQRT2PI_ * std::exp(-0.5 *
y *
y) /
sigma_;
109 return -(Const::_LNSQRT2PI_ + std::log(
double(
sigma_)) + 0.5 *
y *
y);
135 if (
p == 0.5)
return mu_;
142 double q = sqrt(-2*log(
p));
148 double r = (
p-0.5)*(
p-0.5);
154 double q = sqrt(-2*log(1-
p));
198 if (
sigma == 0.)
return (x==
mu) ? 1. : 0.;
201 return Const::_1_SQRT2PI_ * std::exp(-0.5 *
y *
y) /
sigma;
221 return -(Const::_LNSQRT2PI_ + std::log(
double(
sigma)) + 0.5 *
y *
y);
233 if (
sigma == 0)
return (
t <
mu) ? 0. : 1.;
247 if (
p == 0.5)
return mu;
254 double q = sqrt(-2*log(
p));
260 double r = (
p-0.5)*(
p-0.5);
266 double q = sqrt(-2*log(1-
p));
In this file we declare raw the functions.
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
#define STKDOMAIN_ERROR_2ARG(Where, Arg1, Arg2, Error)
virtual Real lpdf(Real const &x) const
virtual Real icdf(Real const &p) const
Compute the inverse cumulative distribution function at p of the standard normal distribution.
Real sigma_
The sigma parameter.
virtual Real pdf(Real const &x) const
virtual Real cdf(Real const &t) const
Compute the cumulative distribution function at t of the standard normal distribution.
Real const & sigma() const
Real mu_
The mu parameter.
Real rand() const
Generate a pseudo Normal random variate.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Real erfc_raw(Real const &a)
Compute the complementary error function erfc(a) Compute the function.
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.