Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ uniform_log() [1/2]

template<bool propto, typename T_y , typename T_low , typename T_high >
return_type_t< T_y, T_low, T_high > stan::math::uniform_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

The log of a uniform density for the given y, lower, and upper bound.

\begin{eqnarray*} y &\sim& \mbox{\sf{U}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta)) &=& \log \left( \frac{1}{\beta-\alpha} \right) \\ &=& \log (1) - \log (\beta - \alpha) \\ &=& -\log (\beta - \alpha) \\ & & \mathrm{ where } \; y \in [\alpha, \beta], \log(0) \; \mathrm{otherwise} \end{eqnarray*}

Deprecated:
use uniform_lpdf
Parameters
yA scalar variable.
alphaLower bound.
betaUpper bound.
Exceptions
std::invalid_argumentif the lower bound is greater than or equal to the lower bound
Template Parameters
T_yType of scalar.
T_lowType of lower bound.
T_highType of upper bound.

Definition at line 35 of file uniform_log.hpp.