LibRan  0.1
Pseudo-random number distribution generator
Functions
LRnexp.c File Reference

The negative-exponential distribution has mean m and deviation m. More...

#include <math.h>
#include "libran.h"
Include dependency graph for LRnexp.c:

Go to the source code of this file.

Functions

double LRd_nexp_RAN (LR_obj *o)
 LRd_nexp_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: peak m = 1. More...
 
double LRd_nexp_PDF (LR_obj *o, double x)
 LRd_nexp_PDF(LR_obj *o, double x) - double negative exponential probablity distribution function. More...
 
double LRd_nexp_CDF (LR_obj *o, double x)
 LRd_nexp_CDF(LR_obj *o, double x) - double negative exponential cumulative distribution function. More...
 
float LRf_nexp_RAN (LR_obj *o)
 LRf_nexp_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: peak m = 1. More...
 
float LRf_nexp_PDF (LR_obj *o, float x)
 LRf_nexp_PDF(LR_obj *o, float x) - float negative exponential probablity distribution function. More...
 
float LRf_nexp_CDF (LR_obj *o, float x)
 LRf_nexp_CDF(LR_obj *o, float x) - float negative exponential cumulative distribution function. More...
 

Detailed Description

The negative-exponential distribution has mean m and deviation m.

The pseudo-random numbers are distributed from a negative exponential distribution. It's only defined on interval $ x \ge 0 $ and zero otherwise. This distribution typically represents the time between events of a Poisson point process, i.e. a process in which events occur continuously and independently at a constant average rate.

\begin{eqnarray*} \mbox{PDF}(x) &= \left\{ \begin{array}{ll} 0, & x < 0 \\ \frac{1}{m} e^{-\frac{x}{m}}, & 0 \le x . \end{array} \right. \\ \\ \mbox{CDF}(x) &= \left\{ \begin{array}{ll} 0, & x < 0 \\ 1 - e^{-\frac{x}{m}}, & 0 \le x . \end{array} \right. \end{eqnarray*}

The default is $ m = 1 $ and s will be set to $ 1/m $ for calculation efficiency. Do not set s when declaring this distribution.

Definition in file LRnexp.c.

Function Documentation

◆ LRd_nexp_CDF()

double LRd_nexp_CDF ( LR_obj o,
double  x 
)

LRd_nexp_CDF(LR_obj *o, double x) - double negative exponential cumulative distribution function.

Parameters
oLR_obj object
xvalue
Returns
double CDF at x

Definition at line 93 of file LRnexp.c.

◆ LRd_nexp_PDF()

double LRd_nexp_PDF ( LR_obj o,
double  x 
)

LRd_nexp_PDF(LR_obj *o, double x) - double negative exponential probablity distribution function.

Parameters
oLR_obj object
xvalue
Returns
double PDF at x

Definition at line 75 of file LRnexp.c.

◆ LRd_nexp_RAN()

double LRd_nexp_RAN ( LR_obj o)

LRd_nexp_RAN(LR_obj *o) - double random negative exponential distribution using the inversion method. Default values: peak m = 1.

Parameters
oLR_obj object
Returns
double

Definition at line 57 of file LRnexp.c.

◆ LRf_nexp_CDF()

float LRf_nexp_CDF ( LR_obj o,
float  x 
)

LRf_nexp_CDF(LR_obj *o, float x) - float negative exponential cumulative distribution function.

Parameters
oLR_obj object
xvalue
Returns
float CDF at x

Definition at line 148 of file LRnexp.c.

◆ LRf_nexp_PDF()

float LRf_nexp_PDF ( LR_obj o,
float  x 
)

LRf_nexp_PDF(LR_obj *o, float x) - float negative exponential probablity distribution function.

Parameters
oLR_obj object
xvalue
Returns
float PDF at x

Definition at line 130 of file LRnexp.c.

◆ LRf_nexp_RAN()

float LRf_nexp_RAN ( LR_obj o)

LRf_nexp_RAN(LR_obj *o) - float random negative exponential distribution using the inversion method. Default values: peak m = 1.

Parameters
oLR_obj object
Returns
float

Definition at line 112 of file LRnexp.c.