Random number distributions


Functions

double eh_rand_exponential (GRand *rand, double mu)
double eh_rand_max_exponential (GRand *rand, double mu, double n)
double eh_log_normal (GRand *rand, double mu, double sigma)
double eh_max_log_normal (GRand *rand, double mu, double sigma, double n)
double eh_rand_weibull (GRand *rand, double eta, double beta)
double eh_rand_max_weibull (GRand *rand, double eta, double beta, double n)
double eh_rand_user (GRand *rand, double *x, double *F, gssize len)
double eh_rand_normal (GRand *rand, double mu, double sigma)
double eh_get_fuzzy_dbl (double min, double max)
double eh_get_fuzzy_dbl_norm (double mean, double std)
double eh_get_fuzzy_dbl_log_norm (double mean, double std)
gint32 eh_get_fuzzy_int (gint32 min, gint32 max)

Function Documentation

double eh_get_fuzzy_dbl ( double  min,
double  max 
)

Definition at line 595 of file eh_rand.c.

Referenced by deposit_sediment_helper(), and eh_dbl_grid_populate().

double eh_get_fuzzy_dbl_log_norm ( double  mean,
double  std 
)

Definition at line 605 of file eh_rand.c.

References eh_log_normal().

double eh_get_fuzzy_dbl_norm ( double  mean,
double  std 
)

Definition at line 600 of file eh_rand.c.

References eh_rand_normal().

gint32 eh_get_fuzzy_int ( gint32  min,
gint32  max 
)

Definition at line 610 of file eh_rand.c.

double eh_log_normal ( GRand *  rand,
double  mu,
double  sigma 
)

Random number from a log-normal distribution.

Pick a random number from a log-normal distribution with mean, mu and standard deviation, sigma.

\[ f(x) = {1 \over \sigma \sqrt{2 \pi} } e^{ \left(\log\left( x-\mu \right)\right)^2 \over 2 \sigma^2 } \]

Parameters:
rand A GRand
mu The scale parameter of the distribution
sigma The shape parameter of the distribution
Returns:
A random number

Definition at line 431 of file eh_rand.c.

References eh_rand_normal().

Referenced by eh_get_fuzzy_dbl_log_norm().

double eh_max_log_normal ( GRand *  rand,
double  mu,
double  sigma,
double  n 
)

Maximum of a series of log-normal random numbers

The maximum of a series of numbers drawn from a log-normal distribution

Parameters:
rand A GRand
mu The scale parameter
sigma The shape parameter
n The number of numbers picked
Returns:
A random number

Definition at line 447 of file eh_rand.c.

References eh_erf_inv(), and eh_ran2().

Referenced by run_quake(), and storm().

double eh_rand_exponential ( GRand *  rand,
double  mu 
)

Random number from an exponential distribution.

Pick a random number from an exponential distribution with mean, mu.

\[ f(x) = {1\over \mu}e^{-{x\over\mu}} \]

Parameters:
rand A GRand
mu The scale parameter of the distribution
Returns:
A random number

Definition at line 379 of file eh_rand.c.

double eh_rand_max_exponential ( GRand *  rand,
double  mu,
double  n 
)

Maximum of a series of exponential random numbers

The maximum of a series of numbers drawn from an exponential distribution

Parameters:
rand A GRand
mu Mean of the distribution
n The number of numbers picked
Returns:
A random number

Definition at line 402 of file eh_rand.c.

double eh_rand_max_weibull ( GRand *  rand,
double  eta,
double  beta,
double  n 
)

Maximum of a series of Weibull random numbers

The maximum of a series of numbers drawn from a Weibull distribution.

Parameters:
rand A GRand
beta Shape parameter
eta Scale parameter
n The number of numbers picked
Returns:
A random number

Definition at line 503 of file eh_rand.c.

Referenced by storm_func_weibull().

double eh_rand_normal ( GRand *  rand,
double  mu,
double  sigma 
)

Random number from a normal distribution

Pick a random number from a normal distribution with mean mu, and standard deviation, sigma.

\[ f(x) = {1 \over \sigma \sqrt{2 \pi} } e^{ \left( x-\mu \right)^2 \over 2 \sigma^2 } \]

Parameters:
rand A GRand
mu Mean of normal distribution
sigma Standard deviation of normal distribution
Returns:
A random number

Definition at line 559 of file eh_rand.c.

References eh_require.

Referenced by avulsion(), eh_get_fuzzy_dbl_norm(), eh_input_val_eval(), and eh_log_normal().

double eh_rand_user ( GRand *  rand,
double *  x,
double *  F,
gssize  len 
)

Random number from a user defined distribution

Pick a random number from a user defined distribution function.

Parameters:
rand A GRand
x x-values of the user-defined CDF
F F-values of the user-defined CDF
len Length of x and y
Returns:
A random number

Definition at line 537 of file eh_rand.c.

References interpolate().

Referenced by eh_input_val_eval().

double eh_rand_weibull ( GRand *  rand,
double  eta,
double  beta 
)

Random number from a Weibull distribution

Pick a random number from a Weibull distribution with shape parameter, beta and scale parameter eta.

\[ f(x) = {\beta \over \eta } \left( {x \over \eta} \right)^{\beta-1} e^{-\left( {x \over \eta} \right)^\beta } \]

Parameters:
rand A GRand
eta Scale parameter
beta Shape parameter
Returns:
A random number

Definition at line 479 of file eh_rand.c.

Referenced by eh_input_val_eval().


Generated on Fri Jan 4 18:04:19 2008 for sedflux by  doxygen 1.5.2