Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ log_gamma_q_dgamma()

template<typename T_a , typename T_z >
std::pair< return_type_t< T_a, T_z >, return_type_t< T_a, T_z > > stan::math::log_gamma_q_dgamma ( const T_a &  a,
const T_z &  z,
double  precision = internal::LOG_Q_GAMMA_CF_PRECISION,
int  max_steps = 250 
)
inline

Compute log(Q(a,z)) and its gradient with respect to a using continued fraction expansion, where Q(a,z) = Gamma(a,z) / Gamma(a) is the regularized upper incomplete gamma function.

This uses a continued fraction representation for numerical stability when computing the upper incomplete gamma function in log space, along with analytical gradient computation.

Template Parameters
T_atype of the shape parameter
T_ztype of the value parameter
Parameters
ashape parameter (must be positive)
zvalue parameter (must be non-negative)
precisionconvergence threshold, default of sqrt(machine_epsilon)
max_stepsmaximum iterations for continued fraction
Returns
structure containing log(Q(a,z)) and d/da log(Q(a,z))

Definition at line 95 of file log_gamma_q_dgamma.hpp.