Revision 595 trunk/contrib/statslib/dnbinom.cpp
dnbinom.cpp (revision 595)  

87  87 
RETURN_ARRAYS_DECREMENT(); 
88  88 
return(loglike); 
89  89 
} 
90 
///** negative log likelihood of negative binomial with mean and size 

91 
//\brief Negative binomial with size and mean 

92 
//\author Mollie Brooks 

93 
//\param x observed count 

94 
//\param mu is the predicted mean 

95 
//\param k is the overdispersion parameter, i.e. shape parameter of underlying heterogeneity (different from tau). should be >0 

96 
//\return negative log likelihood \f$ ( \ln(\Gamma(x+k))\ln(\Gamma(k))\ln(x!)+k\ln(k)+x\ln(\mu)(k+x)\ln(k+\mu) )\f$ 

97 
//**/ 

98  90 
//dvariable dnbinom(const double& x, const prevariable& mu, const prevariable& k) 
99  91 
//{ 
100  92 
// //x is the observed count 
Also available in: Unified diff