Stan Math Library  2.14.0
reverse mode automatic differentiation
logit.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_SCAL_FUN_LOGIT_HPP
2 #define STAN_MATH_REV_SCAL_FUN_LOGIT_HPP
3 
5 #include <stan/math/rev/core.hpp>
7 
8 namespace stan {
9  namespace math {
10 
17  inline var logit(const var& u) {
18  return var(new precomp_v_vari(logit(u.val()),
19  u.vi_,
20  1 / (u.val() - u.val() * u.val())));
21  }
22 
23  }
24 }
25 #endif
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:30
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:42
fvar< T > logit(const fvar< T > &x)
Definition: logit.hpp:16
double val() const
Return the value of this variable.
Definition: var.hpp:230

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