35#ifndef STK_LAW_NORMAL_H
36#define STK_LAW_NORMAL_H
215GetRNGstate();
Real s = Rf_rnorm(
mu, scale); PutRNGstate();
return s;
219{
return Rf_dnorm4(x,
mu, scale,
false);}
221{
return Rf_dnorm4(x,
mu, scale,
true);}
223{
return Rf_pnorm5(t,
mu, scale,
true,
false);}
225{
return Rf_qnorm5(p ,
mu, scale,
true,
false);}
In this file we define the interface base class IUnivLaw for all probabilities laws.
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
#define STKDOMAIN_ERROR_2ARG(Where, Arg1, Arg2, Error)
#define _T(x)
Let x unmodified.
Interface base class for all the univariate distributions.
virtual Real cdfc(Real const &t) const
calculate the complement of cumulative distribution function, called in statistics the survival funct...
virtual Real lcdfc(Real const &t) const
calculate the log-complement of cumulative distribution function Give the log-probability that a rand...
virtual Real lcdf(Real const &t) const
compute the lower tail log-cumulative distribution function Give the log-probability that a random va...
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.
void setMu(Real const &mu)
Normal(Real const &mu=0., Real const &sigma=1.)
Constructor.
Real const & sigma() const
Real mu_
The mu parameter.
Real rand() const
Generate a pseudo Normal random variate.
virtual ~Normal()
Destructor.
void setSigma(Real const &sigma)
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
std::basic_string< Char > String
STK fundamental type of a String.
double Real
STK fundamental type of Real values.
Normal Gaussian
A synonymous for the normal law.
The namespace STK is the main domain space of the Statistical ToolKit project.
Arithmetic properties of STK fundamental types.