1#ifndef STAN_MATH_REV_FUN_INC_BETA_HPP
2#define STAN_MATH_REV_FUN_INC_BETA_HPP
29 avi_->adj_ += adj_ * d_a;
30 bvi_->adj_ += adj_ * d_b;
31 cvi_->adj_ += adj_ * std::pow(1 -
cvi_->val_,
bvi_->val_ - 1)
32 * std::pow(
cvi_->val_,
avi_->val_ - 1) / beta_ab;
inc_beta_vvv_vari(vari *avi, vari *bvi, vari *cvi)
void grad_reg_inc_beta(T &g1, T &g2, const T &a, const T &b, const T &z, const T &digammaA, const T &digammaB, const T &digammaSum, const T &betaAB)
Computes the gradients of the regularized incomplete beta function.
fvar< T > inc_beta(const fvar< T > &a, const fvar< T > &b, const fvar< T > &x)
fvar< T > beta(const fvar< T > &x1, const fvar< T > &x2)
Return fvar with the beta function applied to the specified arguments and its gradient.
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...