|
OPTK
0.1.2
Toolkit for global optimisation algorithms
|
#include <types.hpp>
Public Member Functions | |
| normal (std::string n, double mu, double sigma) | |
| normal (std::string n, double mu, double sigma, pt t) | |
| virtual double | sample () |
Public Member Functions inherited from sspace::param_t | |
| param_t (std::string n, pt t) | |
| virtual | ~param_t () |
| virtual pt | get_type () |
| virtual std::string | get_name () |
Public Attributes | |
| double | m_mu |
| double | m_sigma |
Protected Attributes | |
| std::random_device | rd |
| std::mt19937 | generator |
| std::normal_distribution< double > | dist |
This class is for normally-distributed parameters parametrised by mu and sigma; this is an unconstrained parameter.
| sspace::normal::normal | ( | std::string | n, |
| double | mu, | ||
| double | sigma | ||
| ) |
The constructor.
| n | The name of this parameter |
| mu | The mean of the normal distribution from which to sample |
| variance | The mean of the normal distribution. |
| sspace::normal::normal | ( | std::string | n, |
| double | mu, | ||
| double | sigma, | ||
| pt | t | ||
| ) |
The polymorphic constructor which allows for inheriting classes to specify their types. Do not call.
|
virtual |
Samples a double-precision floating point value from the normal probability distribution:
\[ p(x|\mu\,\sigma) \= \frac{1}{\sigma \sqrt{2 \pi}} e\^{- \frac{{x - \mu}\^ {2}}{2 \sigma \^ {2}} } \]
Reimplemented in sspace::qlognormal, sspace::lognormal, and sspace::qnormal.
| double sspace::normal::m_mu |
The parameters of the underlying normal distribution.
1.8.13