ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Factorial, Gamma and related functions

Functions

double factln (double n)
 Log-factorial $\ln(n!)$. More...
 
dvector factln (const dvector &r)
 Log-factorial of an array. More...
 
double gammln (double xx)
 Log gamma function. More...
 
dvector gammln (const dvector &v)
 Log-Gamma of an array. More...
 
double log_comb (double n, double k)
 Log of the binomial coefficent; i.e log of 'n choose k'. More...
 
dvector log_comb (const dvector &n, const dvector &r)
 Log-binomial of two arrays. More...
 

Detailed Description

Function Documentation

double factln ( double  n)

Log-factorial $\ln(n!)$.

Parameters
na number
Returns
log of the factorial

Definition at line 38 of file combc.cpp.

Referenced by log_comb().

dvector factln ( const dvector r)

Log-factorial of an array.

Parameters
ran array
Returns
log of the factorial

Definition at line 137 of file combc.cpp.

double gammln ( double  xx)

Log gamma function.

Parameters
xx$x$
Returns
$\ln\bigr(\Gamma(x)\bigl)$



The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition, Press, Teukolsky, Vetterling, Flannery, chapter 6

Definition at line 52 of file combc.cpp.

Referenced by beta(), betai(), dbeta(), density_negbinomial(), dgamma(), dinvgamma(), dmultinom(), dnbinom(), dpois(), dstudent_t(), dzinbinom(), factln(), gamma_density(), gammln(), gcf(), get_initial_u(), gser(), inv_cumd_gamma(), lgamma(), lnbeta(), log_density_negbinomial(), log_density_poisson(), log_gamma_density(), log_negbinomial_density(), negbinomial_density(), nllBeta(), nllDirichlet(), nllGamma(), nllInverseGamma(), nllMultiNomial(), nllNegativeBinomial(), nllPoisson(), pbeta(), and randpoisson().

dvector gammln ( const dvector v)

Log-Gamma of an array.

Parameters
van array
Returns
log of the factorial

Definition at line 119 of file combc.cpp.

double log_comb ( double  n,
double  k 
)

Log of the binomial coefficent; i.e log of 'n choose k'.

Parameters
na number
ka number
Returns
$ \ln {n \choose k} $

Definition at line 27 of file combc.cpp.

Referenced by dbinom(), log_comb(), and nllBinomial().

dvector log_comb ( const dvector n,
const dvector r 
)

Log-binomial of two arrays.

Parameters
nan array
ran array
Returns
log of the binomial coefficent

Definition at line 77 of file combc.cpp.