prob
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
prob [2012/12/06 18:12] – ignacy | prob [2024/03/25 18:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
Ignacy Misztal and Deukhwan Lee, University of Georgia \\ | Ignacy Misztal and Deukhwan Lee, University of Georgia \\ | ||
04/ | 04/ | ||
- | |||
- | ==== Introduction ==== | ||
Module Prob is a collection of random number generators / probabilities / | Module Prob is a collection of random number generators / probabilities / | ||
Line 15: | Line 13: | ||
random number generators. Some low level code is from Luis Varona.\\ | random number generators. Some low level code is from Luis Varona.\\ | ||
- | The module contains the following subroutines/functions: | + | ==== Subroutines/functions==== |
'' | '' | ||
Line 21: | Line 19: | ||
called, the seed will be selected by the system. \\ | called, the seed will be selected by the system. \\ | ||
\\ | \\ | ||
+ | |||
'' | '' | ||
a,b - both real (r*) or both integers or both missing.\\ | a,b - both real (r*) or both integers or both missing.\\ | ||
- | If a,b are missing, generates samples from uniform(0, | + | If a,b are missing, generates samples from uniform(0, |
- | If a,b are real (r8), generates samples from uniform(a, | + | If a,b are real (r8), generates samples from uniform(a, |
- | If a,b are integers, generates random integer between a and b. | + | If a,b are integers, generates random integer between a and b \\ |
+ | \\ | ||
+ | |||
'' | '' | ||
mean - (r8) scalar or vector\\ | mean - (r8) scalar or vector\\ | ||
Line 34: | Line 34: | ||
Generates x=N(mean, | Generates x=N(mean, | ||
x=MVN(mean, | x=MVN(mean, | ||
- | |||
Arguments mean and var are optional. If they are missing, sampling is | Arguments mean and var are optional. If they are missing, sampling is | ||
- | from N(0,1) | + | from N(0,1)\\ |
+ | \\ | ||
+ | '' | ||
+ | inv_q_form - (r8) scalar or square matrix containing inverse of quadratic form\\ | ||
+ | df - an integer containing degrees of freedom\\ | ||
- | === Gen_invwishart === | + | Generates samples from inverted chi square or inverted Wishart distributions.\\ |
+ | \\ | ||
+ | '' | ||
+ | x - real(r8) scalar\\ | ||
+ | y - real (r8) contains density(X) for N(0,1)\\ | ||
+ | \\ | ||
+ | '' | ||
+ | x - real (r8) scalar\\ | ||
+ | y - real (r8) cumulative distribution function for N(0,1)\\ | ||
+ | \\ | ||
- | | + | '' |
- | + | x - real (r8) scalar in the range of <0,1>\\ | |
- | inv_q_form - (r8) scalar or square matrix containing inverse of quadratic form | + | y - real (r8) as in: x=normal_cdf(y)\\ |
- | + | \\ | |
- | df - an integer containing degrees of freedom | + | |
- | + | ||
- | + | ||
- | Generates samples from inverted chi square or inverted Wishart distributions. | + | |
- | + | ||
- | + | ||
- | + | ||
- | === Normal === | + | |
- | + | ||
- | + | ||
- | y=normal(x) | + | |
- | + | ||
- | x - real(r8) scalar | + | |
- | + | ||
- | y - real (r8) contains density(X) for N(0,1) | + | |
- | + | ||
- | + | ||
- | + | ||
- | === Normal_cdf === | + | |
- | + | ||
- | + | ||
- | + | ||
- | y=normal_cdf(x) | + | |
- | + | ||
- | x - real (r8) scalar | + | |
- | + | ||
- | y - real (r8) cumulative distribution function for N(0,1) | + | |
- | + | ||
- | + | ||
- | + | ||
- | === Normal_invcdf === | + | |
- | + | ||
- | + | ||
- | y=normal_invcdf(x) | + | |
- | + | ||
- | x - real (r8) scalar in the range of <0,1>. | + | |
- | + | ||
- | y - - real (r8) as in: x=normal_cdf(y) | + | |
- | + | ||
- | + | ||
- | + | ||
- | === Gen_trunc_normal === | + | |
- | + | ||
- | y=generate_trunc_normal(a, | + | |
- | + | ||
- | y - real (r8) scalar or vector | + | |
- | + | ||
- | a,b - real (r8) lower and upper bound of random samples | + | |
- | + | ||
- | mean - real(r8) scalar or vectors of mean, optional if scalar | + | |
- | + | ||
- | var - real(r8) scalar or matricex of variances, optional if scalar | + | |
+ | '' | ||
+ | y - real (r8) scalar or vector\\ | ||
+ | a,b - real (r8) lower and upper bound of random samples\\ | ||
+ | mean - real(r8) scalar or vectors of mean, optional if scalar\\ | ||
+ | var - real(r8) variance or covariance matrix, optional if scalar\\ | ||
+ | \\ | ||
If mean and var are missing, generates random samples from N(0,1) distribution | If mean and var are missing, generates random samples from N(0,1) distribution | ||
- | truncated to interval < | + | truncated to interval < |
+ | \\ | ||
If mean and var are scalars, generates random samples from N(mean, | If mean and var are scalars, generates random samples from N(mean, | ||
- | distribution truncated to interval < | + | distribution truncated to interval < |
If mean is a vector and var is a matrix, generates random samples from | If mean is a vector and var is a matrix, generates random samples from | ||
- | MVN(mean, | + | MVN(mean, |
+ | \\ | ||
=== Other functions/ | === Other functions/ | ||
Line 118: | Line 84: | ||
- |
prob.txt · Last modified: 2024/03/25 18:22 by 127.0.0.1