versatile-mcmc  0.1.7
Functions
math.hpp File Reference

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>
Include dependency graph for math.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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 >
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)
 

Detailed Description

Math utility functions.

Date
05.08.2016
Author
marco.nosp@m.@kle.nosp@m.esiek.nosp@m..com

Function Documentation

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
x1function argument #1
x2function argument #2
mean1distribution mean in dim. 1
mean2distribution mean in dim. 2
sigma1standard deviation in dim. 1
sigma2standard deviation in dim. 2
corrcorrelation 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
xthe function argument
meanthe mean of the distribution.
sigmathe standard deviation.
Returns