Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
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 
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  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
fvar< T > lgamma(const fvar< T > &x)
Definition: lgamma.hpp:15
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
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.
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10

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