All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
lub_free.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_LUB_FREE_HPP
#define STAN_MATH_PRIM_SCAL_FUN_LUB_FREE_HPP
#include <stan/math/prim/scal/err/check_bounded.hpp>
#include <stan/math/prim/scal/fun/logit.hpp>
#include <stan/math/prim/scal/fun/lb_free.hpp>
#include <stan/math/prim/scal/fun/ub_free.hpp>
#include <limits>
namespace stan {
namespace math {
template <typename T, typename TL, typename TU>
inline
typename boost::math::tools::promote_args<T, TL, TU>::type
lub_free(const T y, TL lb, TU ub) {
using stan::math::logit;
stan::math::check_bounded<T, TL, TU>
("stan::math::lub_free",
"Bounded variable",
y, lb, ub);
if (lb == -std::numeric_limits<double>::infinity())
return ub_free(y, ub);
if (ub == std::numeric_limits<double>::infinity())
return lb_free(y, lb);
return logit((y - lb) / (ub - lb));
}
}
}
#endif
lb_free.hpp
stan::math::lub_free
boost::math::tools::promote_args< T, TL, TU >::type lub_free(const T y, TL lb, TU ub)
Return the unconstrained scalar that transforms to the specified lower- and upper-bounded scalar give...
Definition: lub_free.hpp:47
stan::math::ub_free
boost::math::tools::promote_args< T, TU >::type ub_free(const T y, const TU ub)
Return the free scalar that corresponds to the specified upper-bounded value with respect to the spec...
Definition: ub_free.hpp:39
stan::math::lb_free
boost::math::tools::promote_args< T, TL >::type lb_free(const T y, const TL lb)
Return the unconstrained value that produces the specified lower-bound constrained value...
Definition: lb_free.hpp:32
check_bounded.hpp
ub_free.hpp
stan::math::logit
fvar< T > logit(const fvar< T > &x)
Definition: logit.hpp:17
logit.hpp

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