Stan Math Library
4.9.0
Automatic Differentiation
Loading...
Searching...
No Matches
corr_free.hpp
Go to the documentation of this file.
1
#ifndef STAN_MATH_PRIM_CONSTRAINT_CORR_FREE_HPP
2
#define STAN_MATH_PRIM_CONSTRAINT_CORR_FREE_HPP
3
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/err.hpp
>
6
#include <
stan/math/prim/fun/atanh.hpp
>
7
8
namespace
stan
{
9
namespace
math {
10
27
template
<
typename
T>
28
inline
T
corr_free
(
const
T& y) {
29
check_bounded
(
"lub_free"
,
"Correlation variable"
, y, -1.0, 1.0);
30
return
atanh
(y);
31
}
32
33
}
// namespace math
34
}
// namespace stan
35
#endif
stan::math::atanh
fvar< T > atanh(const fvar< T > &x)
Return inverse hyperbolic tangent of specified value.
Definition
atanh.hpp:26
stan::math::check_bounded
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
Definition
check_bounded.hpp:75
stan::math::corr_free
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
stan
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition
unit_vector_constrain.hpp:15
err.hpp
atanh.hpp
meta.hpp
stan
math
prim
constraint
corr_free.hpp
[
Stan Home Page
]
© 2011–2019, Stan Development Team.