MuGen
Multitrait genetics
Modules | Functions
Various distribution functions
Collaboration diagram for Various distribution functions:

Modules

 Wishart sampling functions
 

Functions

void MVgauss (const gsl_vector *, const gsl_matrix *, const gsl_rng *, gsl_vector *)
 Multivariate Gaussian sampling function. More...
 
size_t rtgeom (const double &, const size_t &, const gsl_rng *)
 Truncated geometric distribution. More...
 

Detailed Description

Sampling functions for distributions not already in GSL.

Warning
These are internal functions that are invoked from within classes. Because they need to be as efficient as possible, no range-checking is performed (especially if GSL range checking is turned off at compilation). They rely on the user to keep track of dimensions.

Function Documentation

◆ MVgauss()

void MVgauss ( const gsl_vector *  ,
const gsl_matrix *  ,
const gsl_rng *  ,
gsl_vector *   
)

Multivariate Gaussian sampling function.

This function gives a sample from the MV Gaussian distribution with a given mean and covariance matrix.

Parameters
[in]gsl_vector*pointer to a vector of means
[in]gsl_matrix*pointer to a matrix with the Cholesky-decomposed covariance matrix
[in]gsl_rng*pointer to a pseudo-random number generator (PNG)
[out]gsl_vector*pointer to a destination vector for the sample

◆ rtgeom()

size_t rtgeom ( const double &  ,
const size_t &  ,
const gsl_rng *   
)

Truncated geometric distribution.

Sampling from the truncated geometric distribution, returning a size_t type index value.

Parameters
[in]double&probability of success
[in]size_t&maximum value
[in]gsl_rng*pointer to a PNG
Returns
a value of the type size_t that is a sample from the distribution.