STK++ 0.9.13
|
In this project we compute usual and special functions. More...
Namespaces | |
namespace | STK::Funct |
The namespace Funct enclose all usual and special functions. | |
namespace | STK::Algo |
The namespace Algo enclose all generic algorithms. | |
Classes | |
class | STK::Funct::Serielog1p |
This Series computes. More... | |
class | STK::IFunction< Function > |
Interface base class for functions. More... | |
class | STK::ISerie< Serie > |
Interface base class for Series. More... | |
class | STK::Funct::Seriedl |
This Serie computes. More... | |
Functions | |
template<class Serie > | |
Real | STK::sumAlternateSerie (const ISerie< Serie > &f, int const &n=0) |
Sum an alternating series using the Chebichev polynomials. | |
template<class Serie > | |
Real | STK::sumSerie (const ISerie< Serie > &f, int const &iter_max=10) |
Sum a serie using the epsilon acceleration process. | |
template<class Seriea , class Serieb > | |
Real | STK::continuedFraction (const ISerie< Seriea > &a, const ISerie< Serieb > &b, int const &iter_max=100) |
Evaluate a continued fraction. | |
template<class Function > | |
Real | STK::Algo::SecantMethod (IFunction< Function > const &f, Real const &x0, Real const &x1, Real tol) |
apply the secant method for finding the zero of a function. | |
template<class Function > | |
Real | STK::Algo::BrentMethod (IFunction< Function > const &f, Real const &x0, Real const &x1, Real tol) |
perform the brent's algorithm. | |
template<class Function > | |
Real | STK::Algo::findZero (IFunction< Function > const &f, Real const &x0, Real const &x1, Real tol) |
find the zero of a function. | |
Real | STK::Const::pi () |
compute pi | |
Real | STK::Const::pi_2 () |
Compute ![]() | |
Real | STK::Const::euler () |
Compute the Euler constant. | |
Real | STK::Funct::betaRatio_sr (Real const &a, Real const &b, Real x, bool xm1, bool lower_tail) |
Compute the incomplete beta function ratio I_x(a,b) using its series representation. | |
Real | STK::Funct::betaRatio_up (Real const &a, Real const &b, Real const &x, bool xm1, bool lower_tail) |
Compute the incomplete beta function ratio I_x(a,b) using its recurrence formula and its asymptotic expansion. | |
Real | STK::Funct::betaRatio_cf (Real const &a, Real const &b, Real x, bool xm1, bool lower_tail=true) |
Compute the incomplete beta function ratio using the continued fraction method. | |
Real | STK::Funct::betaRatio_se (Real const &a, Real const &b, Real const &x, bool xm1, bool lower_tail) |
Compute the incomplete beta function ratio I_x(a,b) using the serie expansion method. | |
Real | STK::Funct::betaRatio_ae (Real const &a, Real const &b, Real const &x, bool xm1, bool lower_tail) |
Compute the incomplete beta function ratio I_x(a,b) using the asymptotic expansion method. | |
Real | STK::Funct::betaRatio (Real const &a, Real const &b, Real const &x, bool lower_tail=true) |
Compute the incomplete beta function ratio Compute the beta ratio function. | |
Real | STK::Funct::lanczosSerie (Real const &z) |
Compute the Lanzcos correction series for the gamma function with n = 21 terms. | |
Real | STK::Funct::gammaLanczos (Real const &z) |
Compute the gamma function using the Lanzcos expansion using n = 21 terms and r= 22.618910. | |
double | STK::Funct::stirlingSerie (Real const &z) |
Compute the Stirling's series for the lgamma function. | |
Real | STK::Funct::gammaStirling (Real const &z) |
This function computes the gamma function using the Stirling approximation. | |
Real | STK::Funct::lgammaStirling (Real const &z) |
This function computes the log gamma function using the Stirling approximation. | |
Real | STK::Funct::lgammaStirlingError (Real const &z) |
Compute the error when we compute ![]() | |
Real | STK::Funct::lgammaStirlingError (int n) |
Compute the error when we compute ![]() | |
Real | STK::Funct::factorial (int n) |
This function computes ![]() | |
Real | STK::Funct::factorial (Real const &z) |
This function computes ![]() | |
Real | STK::Funct::lfactorial (int n) |
This function computes ![]() | |
Real | STK::Funct::lfactorial (Real const &z) |
This function computes ![]() | |
Real | STK::Funct::gamma (Real const &z) |
This function computes the function ![]() | |
Real | STK::Funct::lgamma (Real const &z) |
This function computes the function ![]() | |
Real | STK::Funct::gammaRatio (Real const &a, Real const &x, bool lower_tail) |
Compute the incomplete gamma functions ratio. | |
Real | STK::Funct::gammaRatioQ (Real const &a, Real const &x) |
Compute the incomplete gamma function ratio Q(a,x). | |
Real | STK::Funct::gammaRatioP (Real const &a, Real const &x) |
Compute the incomplete gamma function ratio P(a,x). | |
Real | STK::Funct::dev0 (Real const &a, Real const &b) |
compute the partial deviance ![]() | |
Real | STK::Funct::b1 (Real const &a, Real const &b, Real const &x, bool xm1) |
Compute the function. | |
Real | STK::Funct::g0 (Real const &x) |
compute the partial deviance ![]() | |
Real | STK::Funct::log1p (Real const &x) |
compute the function ![]() | |
Real | STK::Funct::expm1 (Real const &x) |
compute the function ![]() | |
Real | STK::Funct::beta_pdf_raw (Real const &x, Real const &a, Real const &b) |
Compute the beta density function. | |
Real | STK::Funct::binomial_pdf_raw (Real const &x, Real const &n, Real const &p) |
Compute the generalized binomial probability mass function. | |
Real | STK::Funct::binomial_pdf_raw (int x, int n, Real const &p) |
Compute the binomial probability mass function. | |
Real | STK::Funct::binomial_lpdf_raw (Real const &x, Real const &n, Real const &p) |
Compute the generalized binomial log-probability mass function. | |
Real | STK::Funct::binomial_lpdf_raw (int x, int n, Real const &p) |
Compute the binomial log-probability mass function. | |
Real | STK::Funct::poisson_pdf_raw (Real const &x, Real const &lambda) |
Compute the Poisson density. | |
Real | STK::Funct::poisson_pdf_raw (int x, Real const &lambda) |
Compute the poisson density with integer value. | |
Real | STK::Funct::poisson_lpdf_raw (Real const &x, Real const &lambda) |
Compute the log-poisson density. | |
Real | STK::Funct::poisson_lpdf_raw (int x, Real const &lambda) |
Compute the log-poisson density with integer value. | |
Real | STK::Funct::erf_raw (Real const &a) |
Compute the error function erf(a) Compute the function. | |
Real | STK::Funct::erfc_raw (Real const &a) |
Compute the complementary error function erfc(a) Compute the function. | |
Real | STK::Funct::normal_cdf_raw (Real const &x) |
Compute the cumulative distribution function of the normal density. | |
Real | STK::Funct::normal_pdf_raw (Real const &x) |
compute the probability distribution function of the normal density. | |
Real | STK::Funct::psi_raw (Real x) |
Compute the psi function. | |
template<int N> | |
Real | STK::Funct::evalPolynomial (Real x, const Real *P) |
Polynomial evaluator. | |
template<int N> | |
Real | STK::Funct::evalPolynomial1 (Real x, const Real *P) |
Polynomial evaluator. | |
Variables | |
const Real | STK::Const::factorialArray [51] |
array for the 51th fisrt factorial elements. | |
const Real | STK::Const::doubleFactorialOddArray [19] |
array for the double factorial of odd numbers. | |
const Real | STK::Const::doubleFactorialEvenArray [20] |
array for the double factorial of even numbers. | |
const Real | STK::Const::doubleFactorialArray [39] |
array for the double factorial. | |
const Real | STK::Const::bernouilliNumbersArray [21] |
Array of the 40th first Bernouilli numbers Bernouilli(n) n=0, 2, 4, ... ,40. | |
In this project we compute usual and special functions.
The Analysis provide all the tools necessary to the computation of the usual and special functions like gamma, beta, gamma ratio, beta ration functions. It provide generic algorithms and the usual mathematical constants.
Compute the function.
using the partial deviance
a,b,x | parameters of the generalized beta |
xm1 | true if x is to be taken as 1-x |
Definition at line 103 of file STK_Funct_raw.h.
References STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), and STK::Funct::log1p().
Compute the beta density function.
Compute the function (beta pdf)
a,b,x | parameters of the beta density |
Definition at line 191 of file STK_Funct_raw.h.
References STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), and STK::Funct::log1p().
Real STK::Funct::betaRatio | ( | Real const & | a, |
Real const & | b, | ||
Real const & | x, | ||
bool | lower_tail = true |
||
) |
Compute the incomplete beta function ratio Compute the beta ratio function.
for
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 547 of file STK_Funct_betaRatio.cpp.
References STK::Funct::betaRatio(), STK::Funct::betaRatio_raw(), STK::isNA(), STK::Arithmetic< Type >::NA(), and STKDOMAIN_ERROR_2ARG.
Referenced by STK::Funct::betaRatio(), STK::Law::Beta::cdf(), and STK::Law::Beta::cdf().
Real STK::Funct::betaRatio_ae | ( | Real const & | a, |
Real const & | b, | ||
Real const & | x, | ||
bool | xm1, | ||
bool | lower_tail | ||
) |
Compute the incomplete beta function ratio I_x(a,b) using the asymptotic expansion method.
Compute the incomplete beta function ratio I_x(a,b) using its asymptotic expansion.
Compute the incomplete beta function ratio I_x(a,b) using it' asymptotic expansion.
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
xm1 | true if we want to evaluate the function at 1-x, false otherwise |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 75 of file STK_Funct_betaRatio.cpp.
References _T, d2, d3, d4, d5, d6, d7, d8, STK::Funct::gammaRatioP(), STK::Funct::gammaRatioQ(), STK::Funct::log1p(), STK::Funct::poisson_pdf_raw(), and stk_cout.
Referenced by STK::Funct::betaRatio_raw(), and STK::Funct::betaRatio_up().
Compute the incomplete beta function ratio using the continued fraction method.
Compute the continued fraction:
with
We are using a new formulation of the
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
xm1 | true if we are looking for 1-x rather than x, false otherwise |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 302 of file STK_Funct_betaRatio.cpp.
References _T, b1, and stk_cout.
Referenced by STK::Funct::betaRatio_raw().
Real STK::Funct::betaRatio_se | ( | Real const & | a, |
Real const & | b, | ||
Real const & | x, | ||
bool | xm1, | ||
bool | lower_tail | ||
) |
Compute the incomplete beta function ratio I_x(a,b) using the serie expansion method.
Compute the incomplete beta function ratio I_x(a,b) using its series expansion.
Compute the incomplete beta function ratio I_x(a,b) using it's series expansion.
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
xm1 | true if we want 1-x value, false otherwise |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 486 of file STK_Funct_betaRatio.cpp.
References _T, a1, a2, STK::Funct::dev0(), STK::Funct::normal_cdf_raw(), and stk_cout.
Referenced by STK::Funct::betaRatio_raw().
Compute the incomplete beta function ratio I_x(a,b) using its series representation.
Compute the incomplete beta function ratio I_x(a,b) using it's series representation.
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
xm1 | true if we want to compute the function at 1-x |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 180 of file STK_Funct_betaRatio.cpp.
References _T, STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), stk_cout, and STK::sum().
Referenced by STK::Funct::betaRatio_raw(), and STK::Funct::betaRatio_up().
Real STK::Funct::betaRatio_up | ( | Real const & | a, |
Real const & | b, | ||
Real const & | x, | ||
bool | xm1, | ||
bool | lower_tail | ||
) |
Compute the incomplete beta function ratio I_x(a,b) using its recurrence formula and its asymptotic expansion.
Compute the incomplete beta function ratio I_x(a,b) using its recurrence formula and its asymptotic expansion.
a,b | first and second parameters, must be >0 |
x | value to evaluate the function |
xm1 | true if we want to evaluate the function at 1-x |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 264 of file STK_Funct_betaRatio.cpp.
References _T, STK::Funct::betaRatio_ae(), STK::Funct::betaRatio_sr(), and stk_cout.
Referenced by STK::Funct::betaRatio_raw().
Compute the binomial log-probability mass function.
Compute the function
. The function assume that there is no NA or infinite values and that 0<=p<=1, n>=0, 0<=x<=n
x,n,p | parameters of the binomial density |
Definition at line 292 of file STK_Funct_raw.h.
References STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), and STK::Funct::log1p().
Compute the generalized binomial log-probability mass function.
Compute the function
. The function assume that there is no NA or infinite values and that 0<=p<=1, n>=0, 0<=x<=n
x,n,p | parameters of the binomial density |
Definition at line 266 of file STK_Funct_raw.h.
References STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), and STK::Funct::log1p().
Referenced by STK::Law::Binomial::lpdf(), and STK::Law::Binomial::lpdf().
Compute the binomial probability mass function.
Compute the function
. The function assume that there is no NA or infinite values and that 0<=p<=1, n>=0, 0<=x<=n
x,n,p | parameters of the binomial density |
Definition at line 253 of file STK_Funct_raw.h.
References STK::Funct::binomial_pdf_raw().
Compute the generalized binomial probability mass function.
Compute the function
. The function assume that there is no NA or infinite values and that 0<=p<=1, n>=0, 0<=x<=n
x,n,p | parameters of the binomial density |
Definition at line 228 of file STK_Funct_raw.h.
References STK::Funct::dev0(), STK::Funct::lgammaStirlingError(), and STK::Funct::log1p().
Referenced by STK::Funct::binomial_pdf_raw(), STK::Law::Binomial::pdf(), and STK::Law::Binomial::pdf().
Real STK::Algo::BrentMethod | ( | IFunction< Function > const & | f, |
Real const & | x0, | ||
Real const & | x1, | ||
Real | tol | ||
) |
perform the brent's algorithm.
f | the function |
x0 | the first point of the algorithm |
x1 | the second point of the algorithm |
tol | the tolerance of the method |
Definition at line 148 of file STK_Algo_FindZero.h.
References _T, MAX_ITER, STK::Arithmetic< Type >::NA(), STK::Algo::SecantMethod(), and stk_cout.
Referenced by STK::Algo::findZero(), and STK::Algo::SecantMethod().
Real STK::continuedFraction | ( | const ISerie< Seriea > & | a, |
const ISerie< Serieb > & | b, | ||
int const & | iter_max = 100 |
||
) |
Evaluate a continued fraction.
Compute
where the coefficients of the series are given or computed by the template parameter Serie.
iter_max | the number of iterations |
a | Denominator serie |
b | Numerator serie |
Definition at line 223 of file STK_Algo.h.
compute the partial deviance
Definition at line 74 of file STK_Funct_raw.h.
References STK::sum().
Referenced by STK::Funct::b1(), STK::Funct::beta_pdf_raw(), STK::Funct::betaRatio_se(), STK::Funct::betaRatio_sr(), STK::Funct::binomial_lpdf_raw(), STK::Funct::binomial_lpdf_raw(), STK::Funct::binomial_pdf_raw(), STK::Law::Poisson::lpdf(), STK::Law::Poisson::lpdf(), STK::Law::Poisson::pdf(), STK::Law::Poisson::pdf(), STK::Funct::poisson_lpdf_raw(), and STK::Funct::poisson_pdf_raw().
Compute the error function erf(a) Compute the function.
[in] | a | value to evaluate the function |
Definition at line 401 of file STK_Funct_raw.h.
Referenced by STK::Funct::erfc_raw().
Compute the complementary error function erfc(a) Compute the function.
[in] | a | value to evaluate the function |
Definition at line 433 of file STK_Funct_raw.h.
References STK::Funct::erf_raw().
Referenced by STK::Law::Normal::cdf(), and STK::Law::Normal::cdf().
Real STK::Const::euler | ( | ) |
Compute the Euler constant.
Polynomial evaluator.
Evaluate the quantity
Definition at line 73 of file STK_Funct_Util.h.
References STK::Funct::evalPolynomial().
Referenced by STK::Funct::evalPolynomial().
Polynomial evaluator.
Evaluate the quantity
N | degree of the polynomial |
Definition at line 90 of file STK_Funct_Util.h.
References STK::Funct::evalPolynomial1().
Referenced by STK::Funct::evalPolynomial1().
compute the function
Definition at line 164 of file STK_Funct_raw.h.
References STK::sum().
This function computes
Compute factorial³Array
for n<51 and using the gamma
function for n>50.
n | given value for the factorial function |
Definition at line 186 of file STK_Funct_gamma.h.
References STK::Funct::factorial(), STK::Funct::factorial_raw(), STK::Arithmetic< Type >::NA(), and STKDOMAIN_ERROR_1ARG.
Referenced by STK::Funct::factorial(), and STK::Funct::factorial().
This function computes
Compute factorialArray
for n<51 and using the gamma
function for n>50.
z | given value for the factorial function |
Definition at line 204 of file STK_Funct_gamma.h.
References STK::Funct::factorial(), STK::Funct::factorial_raw(), and STKDOMAIN_ERROR_1ARG.
Real STK::Algo::findZero | ( | IFunction< Function > const & | f, |
Real const & | x0, | ||
Real const & | x1, | ||
Real | tol | ||
) |
find the zero of a function.
Check if the initial values are inside the domain of definition of the function and call the Brent's method.
f | the function |
x0 | the first starting point of the algorithm |
x1 | the second starting point of the algorithm |
tol | the tolerance to apply |
Definition at line 231 of file STK_Algo_FindZero.h.
References STK::Algo::BrentMethod(), and STK::Arithmetic< Type >::NA().
Referenced by STK::JointGammaModel< Array, WColVector >::computeParameters(), STK::ModelGamma_aj_bj< Data_, WColVector_ >::computeParameters(), STK::JointGammaModel< Array, WColVector >::computeParameters(), STK::ModelGamma_aj_bj< Data_, WColVector_ >::computeParameters(), STK::Gamma_a_bjk< Array >::run(), STK::Gamma_a_bk< Array >::run(), STK::Gamma_aj_bjk< Array >::run(), STK::Gamma_aj_bk< Array >::run(), STK::Gamma_ajk_b< Array >::run(), STK::Gamma_ajk_bj< Array >::run(), STK::Gamma_ajk_bjk< Array >::run(), STK::Gamma_ajk_bk< Array >::run(), STK::Gamma_ak_b< Array >::run(), STK::Gamma_ak_bj< Array >::run(), STK::Gamma_ak_bjk< Array >::run(), and STK::Gamma_ak_bk< Array >::run().
compute the partial deviance
Definition at line 119 of file STK_Funct_raw.h.
References STK::sum().
This function computes the function
The gamma function is valid when z is non zero nor a negative integer. The negative part is computed using the reflection formula
if |z| <8 we use the gamma Lanczos method, else we use the Stirling approximation method.
z | given value for the gamma function |
Definition at line 272 of file STK_Funct_gamma.h.
References STK::Funct::gamma(), STK::Funct::gamma_raw(), and STKDOMAIN_ERROR_1ARG.
Referenced by STK::Funct::gamma().
Compute the gamma function using the Lanzcos expansion using n = 21 terms and r= 22.618910.
z | given value for the gamma function |
Definition at line 86 of file STK_Funct_gamma.h.
References STK::Funct::lanczosSerie().
Referenced by STK::Funct::gamma_raw().
Compute the incomplete gamma functions ratio.
Compute the incomplete gamma function ratio P(a,x)
a | parameter of the gamma ratio function |
x | value to evaluate the gamma ratio function |
lower_tail | true if we want the lower tail, false otherwise |
Definition at line 379 of file STK_Funct_gammaRatio.cpp.
References STK::Funct::gammaRatio_raw(), STK::Funct::gammaRatioP(), STK::isNA(), and STKDOMAIN_ERROR_2ARG.
Referenced by STK::Funct::gammaRatioP(), and STK::Funct::gammaRatioQ().
Compute the incomplete gamma function ratio P(a,x).
Compute the incomplete gamma function ratio P(a,x)
a | parameter of the gamma ratio function |
x | value to evaluate the gamma ratio function |
Definition at line 97 of file STK_Funct_gammaRatio.h.
References STK::Funct::gammaRatio().
Referenced by STK::Funct::betaRatio_ae(), STK::Law::Gamma::cdf(), STK::Law::Gamma::cdf(), and STK::Funct::gammaRatio().
Compute the incomplete gamma function ratio Q(a,x).
Compute the incomplete gamma function ratio Q(a,x)
a | parameter of the gamma ratio function |
x | value to evaluate the gamma ratio function |
Definition at line 85 of file STK_Funct_gammaRatio.h.
References STK::Funct::gammaRatio().
Referenced by STK::Funct::betaRatio_ae(), STK::Law::Poisson::cdf(), and STK::Law::Poisson::cdf().
This function computes the gamma function using the Stirling approximation.
This approximation is valid for large values of z.
z | given value for the gamma function |
Definition at line 123 of file STK_Funct_gamma.h.
References STK::Funct::stirlingSerie().
Referenced by STK::Funct::gamma_raw().
Compute the Lanzcos correction series for the gamma function with n = 21 terms.
z | given value for the lanzcos Series |
Definition at line 73 of file STK_Funct_gamma.h.
References STK::sum().
Referenced by STK::Funct::gammaLanczos().
This function computes
Compute factorialLnArray
for n<51 and using the gamma
function for n>50.
n | given value for the factorial function |
Definition at line 225 of file STK_Funct_gamma.h.
References STK::Funct::lfactorial(), STK::Funct::lfactorial_raw(), and STKDOMAIN_ERROR_1ARG.
Referenced by STK::Funct::lfactorial(), and STK::Funct::lfactorial().
This function computes
Compute
z | given value for the factorial function |
Definition at line 245 of file STK_Funct_gamma.h.
References STK::Funct::lfactorial(), STK::Funct::lfactorial_raw(), and STKDOMAIN_ERROR_1ARG.
This function computes the function
The log gamma function is valid when z is non zero nor a negative integer. if |z| <16 we use the gamma Lanczos method, else we use the Stirling approxiamtion method.
z | given value for the gamma function |
Definition at line 330 of file STK_Funct_gamma.h.
References STK::Funct::lgamma(), STK::Funct::lgamma_raw(), and STKDOMAIN_ERROR_1ARG.
Referenced by STK::Funct::lfactorial_raw(), STK::Funct::lfactorial_raw(), STK::Funct::lgamma(), STK::Funct::lgammaStirlingError(), and STK::GammaBase< Derived >::qValue().
This function computes the log gamma function using the Stirling approximation.
This approximation is valid for large values of z.
z | given value for log gamma function |
Definition at line 133 of file STK_Funct_gamma.h.
References STK::Funct::stirlingSerie().
Referenced by STK::Funct::lgamma_raw().
Compute the error when we compute
Computes the ln of the error term in Stirling's formula. For z <100, integers or half-integers, use stored values. For z >= 100, uses the stirling series
n | given value for the gamma function |
Definition at line 175 of file STK_Funct_gamma.h.
References STK::Funct::stirlingSerie().
Compute the error when we compute
Computes the ln of the error term in Stirling's formula. For z <100, integers or half-integers, use stored values. For z >= 100, uses the stirling serie
z | given value for the gamma function |
Definition at line 149 of file STK_Funct_gamma.h.
References STK::Funct::lgamma(), and STK::Funct::stirlingSerie().
Referenced by STK::Funct::b1(), STK::Funct::beta_pdf_raw(), STK::Funct::betaRatio_sr(), STK::Funct::binomial_lpdf_raw(), STK::Funct::binomial_lpdf_raw(), STK::Funct::binomial_pdf_raw(), STK::Law::Poisson::lpdf(), STK::Law::Poisson::lpdf(), STK::Law::Poisson::pdf(), STK::Law::Poisson::pdf(), STK::Funct::poisson_lpdf_raw(), and STK::Funct::poisson_pdf_raw().
compute the function
x | value to evaluate the function |
Definition at line 145 of file STK_Funct_raw.h.
References STK::sumAlternateSerie().
Referenced by STK::Funct::b1(), STK::Funct::beta_pdf_raw(), STK::Funct::betaRatio_ae(), STK::Funct::binomial_lpdf_raw(), STK::Funct::binomial_lpdf_raw(), and STK::Funct::binomial_pdf_raw().
Compute the cumulative distribution function of the normal density.
Compute the cumulative distribution function of the normal density
where
and
.
x | value to evaluate the function |
Definition at line 498 of file STK_Funct_raw.h.
Referenced by STK::Funct::betaRatio_se().
compute the probability distribution function of the normal density.
compute the probability density function of the normal density
x | value to evaluate the function |
Definition at line 514 of file STK_Funct_raw.h.
Real STK::Const::pi | ( | ) |
compute pi
Referenced by STK::Const::pi_2().
|
inline |
Compute the log-poisson density with integer value.
Compute the function:
with good accuracy using the partial deviance. This is the version for x integer.
x | value to evaluate the function |
lambda | value of the parameter |
Definition at line 390 of file STK_Funct_raw.h.
References STK::Funct::poisson_lpdf_raw().
Compute the log-poisson density.
Compute the function:
with good accuracy using the partial deviance. This is the version for x Real.
x | value to evaluate the function |
lambda | value of the parameter |
Definition at line 364 of file STK_Funct_raw.h.
References STK::Funct::dev0(), and STK::Funct::lgammaStirlingError().
Referenced by STK::Law::Gamma::lpdf(), STK::Law::Gamma::lpdf(), and STK::Funct::poisson_lpdf_raw().
Compute the poisson density with integer value.
Compute the function:
with good accuracy using the partial deviance. This is the version for x integer.
x | value to evaluate the function |
lambda | value of the parameter |
Definition at line 347 of file STK_Funct_raw.h.
References STK::Funct::poisson_pdf_raw().
Compute the Poisson density.
Compute the function:
with good accuracy using the partial deviance. This is the version for x Real.
x | value to evaluate the function |
lambda | value of the parameter |
Definition at line 321 of file STK_Funct_raw.h.
References STK::Funct::dev0(), and STK::Funct::lgammaStirlingError().
Referenced by STK::Funct::betaRatio_ae(), STK::Law::Gamma::pdf(), STK::Law::Gamma::pdf(), and STK::Funct::poisson_pdf_raw().
Compute the psi function.
Compute the psi function
the logarithmic derivative of the gamma function.
For integer x, we use the formula
This formula is used for 0 < n <= 20.
If x is negative, it is transformed to a positive argument by the reflection formula
For general positive x, the argument is made greater than 10 using the recurrence
where the
Definition at line 542 of file STK_Funct_raw.h.
References STK::Const::bernouilliNumbersArrayDivBy2K.
Referenced by STK::JointGammaModel< Array, WColVector >::dloglikelihood::fImpl(), STK::ModelGamma_aj_bj< Data_, WColVector_ >::dloglikelihood::fImpl(), STK::hidden::invPsiMLog::fImpl(), and STK::hidden::invPsi::fImpl().
Real STK::Algo::SecantMethod | ( | IFunction< Function > const & | f, |
Real const & | x0, | ||
Real const & | x1, | ||
Real | tol | ||
) |
apply the secant method for finding the zero of a function.
Compute iteratively
in order to find the zero of the function f.
Some details of the implementation :
f | the function |
x0 | the first point of the algorithm |
x1 | the second point of the algorithm |
tol | the tolerance of the method |
Definition at line 79 of file STK_Algo_FindZero.h.
References STK::Algo::BrentMethod(), and STK::Arithmetic< Type >::NA().
Referenced by STK::Algo::BrentMethod().
Compute the Stirling's series for the lgamma function.
z | given value for the stirling Series |
Definition at line 98 of file STK_Funct_gamma.h.
Referenced by STK::Funct::gammaStirling(), STK::Funct::lgamma_raw(), STK::Funct::lgammaStirling(), STK::Funct::lgammaStirlingError(), and STK::Funct::lgammaStirlingError().
Sum an alternating series using the Chebichev polynomials.
Compute
where the coefficients of the series are given or computed using the parameter ISerie
.
The number of iterations is the first number such that
where
f | the ISerie giving the terms of the serie |
n | the number of iterations |
Definition at line 65 of file STK_Algo.h.
References STK::sum().
Referenced by STK::Funct::log1p().
Sum a serie using the epsilon acceleration process.
Compute
where the coefficients of the series are given or computed by the template parameter Serie.
The series should be monotone in absolute value. We use the epsilon algorithm acceleration process with 6 epsilon.
f | the functor giving the terms of the serie |
iter_max | the number of iterations |
Definition at line 110 of file STK_Algo.h.
References STK::sum().
Array of the 40th first Bernouilli numbers Bernouilli(n) n=0, 2, 4, ... ,40.
Definition at line 696 of file STK_Const_Sequences.h.
array for the double factorial.
The coefficients (2n)!! have been found on http://oeis.org/.
Definition at line 649 of file STK_Const_Sequences.h.
array for the double factorial of even numbers.
The coefficients
Definition at line 620 of file STK_Const_Sequences.h.
array for the double factorial of odd numbers.
The coefficients
Definition at line 591 of file STK_Const_Sequences.h.
array for the 51th fisrt factorial elements.
The coefficients
Definition at line 55 of file STK_Const_Sequences.h.
Referenced by STK::Funct::factorial_raw(), STK::Funct::factorial_raw(), and STK::Funct::gamma_raw().