Function cmb_random_t_dist

Function Documentation

static inline double cmb_random_t_dist(const double m, const double s, const double v)

A location - scale generalization of Student’s t distribution.

Mean m for v > 1, variance s * s * v /(v - 2) for v > 2, otherwise undefined.

Can be used as a drop-in replacement for normal distributions if fatter tails are needed. It is equal to a Cauchy distribution for v = 1, converges to a normal distribution N(m, s) for v -> oo.

See also https://en.wikipedia.org/wiki/Student%27s_t-distribution