| Stan Math Library 2.11.0 reverse mode automatic differentiation

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

inc_beta_ddz.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_INC_BETA_DERIVATIVES_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_INC_BETA_DERIVATIVES_HPP
3
4 #include <stan/math/prim/scal/fun/lgamma.hpp>
5 #include <stan/math/prim/scal/fun/inc_beta.hpp>
6 #include <boost/math/special_functions/beta.hpp>
7 #include <cmath>
8
9 namespace stan {
10 namespace math {
11
26 template <typename T>
27 T inc_beta_ddz(T a, T b, T z) {
28 using std::exp;
29 using std::log;
30 return exp((b - 1) * log(1 - z) + (a - 1) * log(z)
31 + lgamma(a + b) - lgamma(a) - lgamma(b));
32 }
33
34 template <>
35 inline double inc_beta_ddz(double a, double b, double z) {
36 using boost::math::ibeta_derivative;
37 return ibeta_derivative(a, b, z);
38 }
39
40 } // math
41 } // stan
42
43 #endif
lgamma.hpp
stan::math::lgamma
fvar< T > lgamma(const fvar< T > &x)
Definition: lgamma.hpp:15
stan
Definition: log_sum_exp.hpp:8
stan::math::log
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
stan::math::inc_beta_ddz
T inc_beta_ddz(T a, T b, T z)
Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to z.
Definition: inc_beta_ddz.hpp:27
stan::math::exp
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
inc_beta.hpp

[ Stan Home Page ] © 2011–2016, Stan Development Team.