template<typename RngType = DefaultRngType>
class shark::Normal< RngType >
Implements a univariate normal (Gaussian) distribution.
For backwards compatibility with older shark versions instead of the standard deviation sigma the variance=sigma^2 is used as argument.
Definition at line 52 of file Normal.h.
template<typename RngType = DefaultRngType>
Calculate log(p(x))
std::log can get -inf before it returns NaN. shark::safeLog tries to save the day, however is not perfect. The only real solution is to implement a function logP inside the distributions which returns the energy of the state
- Note
- subclasses should implement their own version of this function instead of replying on the default implementation unless you are pretty sure what you are doing.
- Parameters
-
x | the input for calculating log of probability |
- Returns
- log of probability of input
Reimplemented from shark::AbstractDistribution.
Definition at line 103 of file Normal.h.
References shark::Normal< RngType >::mean(), shark::safeLog(), shark::sqr(), and shark::SQRT_2_PI.