Math utility functions.
More...
#include <cmath>
#include <type_traits>
#include <boost/math/special_functions/pow.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/distributions/normal.hpp>
Go to the source code of this file.
|
|
template<typename T , class = typename std::enable_if<std::is_integral<T>::value>::type> |
| bool | vmcmc::math::isOdd (const T &v) |
| |
|
template<typename T , class = typename std::enable_if<std::is_integral<T>::value>::type> |
| bool | vmcmc::math::isEven (const T &v) |
| |
|
template<typename T > |
| T & | vmcmc::math::constrain (T &input, const T &min, const T &max) |
| |
|
template<typename T > |
| T | vmcmc::math::constrain (T &&input, const T &min, const T &max) |
| |
| double | vmcmc::math::normalPDF (double x, double mean=0.0, double sigma=1.0) |
| | A standard normal (Gaussian) distribution. More...
|
| |
| double | vmcmc::math::biVariateNormalPDF (double x1, double x2, double mean1=0.0, double mean2=0.0, double sigma1=1.0, double sigma2=1.0, double corr=0.0) |
| | A 2-dimensional normal distribution. More...
|
| |
|
double | vmcmc::math::normal1SidedCDF (double nSigmas) |
| |
|
double | vmcmc::math::normal1SidedQuantile (double prob) |
| |
|
double | vmcmc::math::chiSquareQuantile (double prob, size_t nParams) |
| |
|
double | vmcmc::math::chiSquareQuantileFromSigmas (double nSigmas, size_t nParams) |
| |
|
double | vmcmc::math::chiSquareCDF (double value, size_t nParams) |
| |
|
double | vmcmc::math::chiSquareToSigmas (double value, size_t nParams) |
| |
Math utility functions.
- Copyright
- Copyright 2016 Marco Kleesiek. Released under the GNU Lesser General Public License v3.
- Date
- 05.08.2016
- Author
- marco.nosp@m.@kle.nosp@m.esiek.nosp@m..com
| double vmcmc::math::biVariateNormalPDF |
( |
double |
x1, |
|
|
double |
x2, |
|
|
double |
mean1 = 0.0, |
|
|
double |
mean2 = 0.0, |
|
|
double |
sigma1 = 1.0, |
|
|
double |
sigma2 = 1.0, |
|
|
double |
corr = 0.0 |
|
) |
| |
A 2-dimensional normal distribution.
- Parameters
-
| x1 | function argument #1 |
| x2 | function argument #2 |
| mean1 | distribution mean in dim. 1 |
| mean2 | distribution mean in dim. 2 |
| sigma1 | standard deviation in dim. 1 |
| sigma2 | standard deviation in dim. 2 |
| corr | correlation between x1 and x2 |
- Returns
| double vmcmc::math::normalPDF |
( |
double |
x, |
|
|
double |
mean = 0.0, |
|
|
double |
sigma = 1.0 |
|
) |
| |
|
inline |
A standard normal (Gaussian) distribution.
- Parameters
-
| x | the function argument |
| mean | the mean of the distribution. |
| sigma | the standard deviation. |
- Returns