Stan Math Library  2.12.0
reverse mode automatic differentiation
corr_free.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_CORR_FREE_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_CORR_FREE_HPP
3 
5 #include <cmath>
6 
7 namespace stan {
8  namespace math {
9 
26  template <typename T>
27  inline
28  T corr_free(const T y) {
29  check_bounded("lub_free",
30  "Correlation variable", y, -1.0, 1.0);
31  return atanh(y);
32  }
33 
34  }
35 }
36 #endif
fvar< T > atanh(const fvar< T > &x)
Definition: atanh.hpp:13
T corr_free(const T y)
Return the unconstrained scalar that when transformed to a valid correlation produces the specified v...
Definition: corr_free.hpp:28
bool check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Return true if the value is between the low and high values, inclusively.

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