29 #ifndef _biomcmc_prob_distribution_h_ 30 #define _biomcmc_prob_distribution_h_ 58 double biomcmc_dgamma (
double x,
double alpha,
double beta,
bool log_p);
60 double biomcmc_qgamma (
double p,
double alpha,
double beta,
bool log_p);
63 double biomcmc_pgamma (
double x,
double alpha,
double beta,
bool log_p);
65 double biomcmc_dnorm (
double x,
double mu,
double sigma,
bool log_p);
66 double biomcmc_qnorm (
double p,
double mu,
double sigma,
bool log_p);
67 double biomcmc_pnorm (
double x,
double mu,
double sigma,
bool log_p);
69 double biomcmc_dlnorm (
double x,
double meanlog,
double sdlog,
bool log_p);
70 double biomcmc_qlnorm (
double p,
double meanlog,
double sdlog,
bool log_p);
71 double biomcmc_plnorm (
double x,
double meanlog,
double sdlog,
bool log_p);
73 double biomcmc_dpois (
double x,
double lambda,
bool log_p);
75 double biomcmc_qpois (
double p,
double lambda,
bool log_p);
76 double biomcmc_ppois (
double x,
double lambda,
bool log_p);
78 double biomcmc_rng_gamma (
double alpha,
double beta);
81 double biomcmc_rng_lnorm (
double meanlog,
double sdlog);
82 double biomcmc_rng_pois (
double mu);
86 double biomcmc_lgammafn (
double x,
int *sgn);
88 double biomcmc_gammafn (
double x);
98 discrete_sample new_discrete_sample_from_frequencies (
double *prob,
size_t size);
100 void del_discrete_sample (discrete_sample g);
102 size_t biomcmc_rng_discrete (discrete_sample g);
104 double biomcmc_discrete_sample_pdf (discrete_sample g,
size_t k);
107 double biomcmc_logspace_add (
double logx,
double logy);
109 double biomcmc_logspace_sub (
double logx,
double logy);
Random number generation, with algorithms from the Gnu Scientific Library (GSL) and motivation from t...
double biomcmc_pgamma(double x, double alpha, double beta, bool log_p)
computes the cummulative distribution function for the gamma distribution with shape parameter alpha ...
Definition: prob_distribution.c:201
Definition: prob_distribution.h:38
double biomcmc_log1pmx(double x)
accurate calculation of , particularly for small x
Definition: prob_distribution.c:872
double biomcmc_expm1(double x)
compute accurately also when x is close to zero, i.e.
Definition: prob_distribution.c:886
bool biomcmc_isfinite(double x)
check if number is between minus infinity and plus infinity, or NaN
Definition: prob_distribution.c:1102
Lowest level header file. Header file for lowlevel.c.
double biomcmc_pexp_dt(double d, double lambda, double m, bool log_p)
cdf of discrete truncated exponential (d is discrete, m is maximum value): calculates P(D <= d) ...
Definition: prob_distribution.c:65
double biomcmc_log1p(double x)
compute the relative error logarithm (C99 standard)
Definition: prob_distribution.c:827
double biomcmc_qgamma(double p, double alpha, double beta, bool log_p)
gamma quantile (inverse CDF)
Definition: prob_distribution.c:121
double biomcmc_dexp_dt(double d, double lambda, double m, bool log_p)
pdf of discrete truncated exponential (d is discrete, m is maximum value)
Definition: prob_distribution.c:53
double biomcmc_rng_norm(double mu, double sigma)
Returns a random number from a Normal distribution N(mu, sigma^2) using 52 bits of precision...
Definition: prob_distribution.c:522
void biomcmc_discrete_gamma(double alpha, double beta, double *rate, int nrates)
Ziheng Yang's gamma discretization of rates.
Definition: prob_distribution.c:34
double biomcmc_dgamma(double x, double alpha, double beta, bool log_p)
gamma density
Definition: prob_distribution.c:92
double biomcmc_qexp_dt(double p, double lambda, double m, bool log_p)
quantile of discrete truncated exponential, that is, finds d s.t. P(D <= d) >= p
Definition: prob_distribution.c:77