Stan Math Library
5.0.0
Automatic Differentiation
|
return_type_t< T_y, T_low, T_high > stan::math::uniform_lpdf | ( | 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*}
T_y | type of scalar |
T_low | type of lower bound |
T_high | type of upper bound |
y | A scalar variable. |
alpha | Lower bound. |
beta | Upper bound. |
std::invalid_argument | if the lower bound is greater than or equal to the lower bound |
Definition at line 47 of file uniform_lpdf.hpp.