ADMB Documentation  11.5.3197
 All Classes Files Functions Variables Typedefs Friends Defines
Functions
Factorial, gamma and related functions.

Functions

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

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(), lnbeta(), log_density_negbinomial(), log_density_poisson(), log_gamma_density(), log_negbinomial_density(), negbinomial_density(), nllBeta(), nllDirichlet(), nllGamma(), nllInverseGamma(), nllMultiNomial(), nllNegativeBinomial(), nllPoisson(), 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.