Automatic Differentiation
 
Loading...
Searching...
No Matches
inc_beta_ddz.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_INC_BETA_DDZ_HPP
2#define STAN_MATH_PRIM_FUN_INC_BETA_DDZ_HPP
3
9#include <boost/math/special_functions/beta.hpp>
10#include <cmath>
11
12namespace stan {
13namespace math {
14
29template <typename T>
30T inc_beta_ddz(T a, T b, T z) {
31 using std::exp;
32 using std::log;
33 return exp((b - 1) * log1m(z) + (a - 1) * log(z) + lgamma(a + b) - lgamma(a)
34 - lgamma(b));
35}
36
37template <>
38inline double inc_beta_ddz(double a, double b, double z) {
39 using boost::math::ibeta_derivative;
40 return ibeta_derivative(a, b, z);
41}
42
43} // namespace math
44} // namespace stan
45#endif
T inc_beta_ddz(T a, T b, T z)
Returns the partial derivative of the regularized incomplete beta function, I_{z}(a,...
fvar< T > log(const fvar< T > &x)
Definition log.hpp:18
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
Definition lgamma.hpp:21
fvar< T > log1m(const fvar< T > &x)
Definition log1m.hpp:12
fvar< T > exp(const fvar< T > &x)
Definition exp.hpp:15
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...