Complete and incomplete gamma function approximations. More...
#include <cmath>#include "vnl/vnl_export.h"Go to the source code of this file.
Functions | |
| VNL_EXPORT double | vnl_log_gamma (double x) |
| Approximate log of gamma function. More... | |
| double | vnl_gamma (double x) |
| Approximate gamma function. More... | |
| VNL_EXPORT double | vnl_gamma_p (double a, double x) |
| Normalised Incomplete gamma function, P(a,x). More... | |
| VNL_EXPORT double | vnl_gamma_q (double a, double x) |
| Normalised Incomplete gamma function, Q(a,x). More... | |
| double | vnl_cum_prob_chi2 (int n_dof, double chi2) |
| P(chi<chi2). More... | |
| VNL_EXPORT double | vnl_digamma (double x) |
| approximate digamma function, dLog[gamma[z]]/dz. More... | |
Complete and incomplete gamma function approximations.
Definition in file vnl_gamma.h.
|
inline |
P(chi<chi2).
Calculates the probability that a value generated at random from a chi-square distribution with given degrees of freedom is less than the value chi2
| n_dof | Number of degrees of freedom |
| chi2 | Value of chi-squared |
Definition at line 43 of file vnl_gamma.h.
| VNL_EXPORT double vnl_digamma | ( | double | x | ) |
approximate digamma function, dLog[gamma[z]]/dz.
Analytic derivative of the Lanczos approximation. Error < 10^-11 1<z<20.
Definition at line 114 of file vnl_gamma.cxx.
|
inline |
Approximate gamma function.
Uses 6 parameter Lanczos approximation as described by Toth (http://www.rskey.org/gamma.htm) Accurate to about one part in 3e-11.
Definition at line 25 of file vnl_gamma.h.
| VNL_EXPORT double vnl_gamma_p | ( | double | a, |
| double | x | ||
| ) |
Normalised Incomplete gamma function, P(a,x).
Note the order of parameters - this is the normal maths order. MATLAB uses gammainc(x,a), ie the other way around
Definition at line 92 of file vnl_gamma.cxx.
| VNL_EXPORT double vnl_gamma_q | ( | double | a, |
| double | x | ||
| ) |
| VNL_EXPORT double vnl_log_gamma | ( | double | x | ) |
Approximate log of gamma function.
Uses 6 parameter Lanczos approximation as described by Toth (http://www.rskey.org/gamma.htm) Accurate to about one part in 3e-11.
Approximate log of gamma function.
Uses 6 parameter Lanczos approximation as described by Viktor Toth (http://www.rskey.org/gamma.htm) Accurate to about 3e-11.
Definition at line 18 of file vnl_gamma.cxx.
1.8.15