NAME

sample_from_gamma_distribution - Samples from a gaussian distribution

SYNOPSIS

#include "sample/sample_misc.h"

Example compile flags (system dependent):
  -DLINUX_X86_64 -DLINUX_X86_64_OPTERON  -DGNU_COMPILER 
   -I/home/kobus/include
   -L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
  -lKJB                               -lfftw3  -lgsl -lgslcblas -ljpeg  -lSVM -lstdc++                    -lpthread -lSLATEC -lg2c    -lacml -lacml_mv -lblas -lg2c      -lncursesw 


double sample_from_gamma_distribution
(
	double alpha,
	double beta,
	double a,
	double b
);

DESCRIPTION

Samples from a gamma distribution with shape alpha, and scale beta over the sampling interval [a,b].

RETURNS

The sampled value

NOTE

This approach uses rejection sampling with a uniform distribution as the model distribution. As such, running time depends heavilly on choice of a,b and the peakiness of the distribution (i.e. size of alpha). For distributions with sharp peaks (large alpha), sample_from_gamma_distribution_2() is recommended, as it makes guarantees on the expected running time.

RELATED

gamma_pdf

DISCLAIMER

This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.

AUTHOR

Luca Del Pero

DOCUMENTER

Luca Del Pero, Kyle Simek

SEE ALSO

kjb_rand_int , sample_from_discrete_distribution , sample_from_uniform_distribution , poisson_rand , gamma_pdf , log_gamma_pdf , sample_from_gamma_distribution_2 , pick_m_from_n