Implements a log-normal distribution with parameters location m and Scale s. More...
#include <shark/Rng/LogNormal.h>
Public Member Functions | |
LogNormal (RngType &rng, double location=0, double scale=1) | |
C'tor, associates the distribution with a custom RNG. More... | |
double | operator() (double location, double scale) |
Samples a random number. More... | |
double | location () const |
Accesses the location of the distribution. More... | |
double | scale () const |
Accesses the scale of the distribution. More... | |
void | location (double newLocation) |
Adjusts the location of the distribution. More... | |
void | scale (double newScale) |
Adjusts the scale of the distribution. More... | |
double | p (double x) const |
Calculates the probability of x > 0. More... | |
Implements a log-normal distribution with parameters location m and Scale s.
The propability distribution is
\[ p(x)= \frac {1} {x s \sqrt{2 \pi}}e^{-\frac{(\ln x -m)^2}{2 s^2}}\]
Definition at line 53 of file LogNormal.h.
|
inline |
C'tor, associates the distribution with a custom RNG.
[in,out] | rng | The custom rng. |
[in] | location | The location of the distribution, default value is 0. |
[in] | scale | The scale of the distribution, default value is 1. |
Definition at line 73 of file LogNormal.h.
|
inline |
Accesses the location of the distribution.
Definition at line 96 of file LogNormal.h.
Referenced by shark::LogNormal< RngType >::location(), shark::LogNormal< RngType >::p(), and shark::LogNormal< RngType >::scale().
|
inline |
Adjusts the location of the distribution.
Definition at line 110 of file LogNormal.h.
References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().
|
inline |
Samples a random number.
[in] | location | The location of the distribution. |
[in] | scale | The scale of the distribution. |
Definition at line 89 of file LogNormal.h.
|
inline |
Calculates the probability of x > 0.
Definition at line 129 of file LogNormal.h.
References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().
|
inline |
Accesses the scale of the distribution.
Definition at line 103 of file LogNormal.h.
Referenced by shark::LogNormal< RngType >::location(), shark::LogNormal< RngType >::p(), and shark::LogNormal< RngType >::scale().
|
inline |
Adjusts the scale of the distribution.
Definition at line 120 of file LogNormal.h.
References shark::LogNormal< RngType >::location(), and shark::LogNormal< RngType >::scale().