36#include "../include/STK_Law_Cauchy.h"
50{
return mu_ +
scale_ *
Real(std::tan(
double(Const::_PI_ * generator.randUnif())));}
63 return mu +
scale *
Real(std::tan(
double(Const::_PI_ * generator.randUnif()) ));
76 return 1. / (Const::_PI_ *
scale_ * (1. +
y *
y));
94 return 1. / (Const::_PI_ *
scale * (1. +
y *
y));
107 return -
Real(std::log(
double(Const::_PI_ *
scale_ * (1. +
y *
y)) ));
126 return -
Real(std::log(
double(Const::_PI_ *
scale * (1. +
y *
y)) ));
137 return (
t < 0.) ? 0.0 : 1.0;
145 if (std::abs(
td) > 1)
147 Real y =
Real(std::atan( 1./
double(
td))) / Const::_PI_;
148 return (
td > 0) ? (1. -
y) : (-
y);
150 return 0.5 +
Real(std::atan(
double(
td))) / Const::_PI_;
161 if ((
p > 1.) || (
p < 0.))
180 return (
t < 0.) ? 0.0 : 1.0;
188 if (std::abs(
td) > 1)
190 Real y =
Real(std::atan( 1./
double(
td))) / Const::_PI_;
191 return (
td > 0) ? (1. -
y) : (-
y);
193 return 0.5 +
Real(std::atan(
double(
td))) / Const::_PI_;
204 if ((
p > 1.) || (
p < 0.))
212 return mu -
scale /
Real(std::tan(
double(Const::_PI_ *
p) ));
#define STKDOMAIN_ERROR_1ARG(Where, Arg, Error)
#define STKDOMAIN_ERROR_2ARG(Where, Arg1, Arg2, Error)
virtual Real pdf(Real const &x) const
Cauchy(Real const &mu=0, Real const &scale=1)
Default constructor.
Real scale_
The scale parameter.
virtual Real rand() const
Generate a pseudo Cauchy random variate.
Real const & scale() const
virtual Real lpdf(Real const &x) const
virtual Real cdf(Real const &t) const
The cumulative distribution function of the Cauchy distribution at t is.
Real mu_
The mu parameter.
virtual Real icdf(Real const &p) const
The inverse cumulative distribution function at p is.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
bool isNA(Type const &x)
utility method allowing to know if a value is a NA (Not Available) value
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.
static Type NA()
Adding a Non Available (NA) special number.