ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cgamdens.cpp
Go to the documentation of this file.
1 
9 //double get_values(double x,double y,int print_switch);
10 #include "fvar.hpp"
11 
21 double gamma_density(double x,double r, double mu)
22 {
23  return exp(r*log(mu) + (r-1)*log(x)-mu*x-gammln(r));
24 }
25 
35 double log_gamma_density(double x,double r, double mu)
36 {
37  return r*log(mu) + (r-1)*log(x)-mu*x-gammln(r);
38 }
double gammln(double xx)
Log gamma function.
Definition: combc.cpp:52
#define x
double gamma_density(double x, double r, double mu)
Gamma probability density function; constant objects.
Definition: cgamdens.cpp:21
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13
double log_gamma_density(double x, double r, double mu)
Log gamma probability density function; constant objects.
Definition: cgamdens.cpp:35