User Tools

Site Tools


prob

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
prob [2012/12/06 18:12] ignacyprob [2012/12/06 19:08] ignacy
Line 2: Line 2:
 Ignacy Misztal and Deukhwan Lee, University of Georgia \\ Ignacy Misztal and Deukhwan Lee, University of Georgia \\
 04/29/99-04/19/2001 \\ 04/29/99-04/19/2001 \\
- 
-==== 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==== 
  
 ''call set_seed(n)'' \\ ''call set_seed(n)'' \\
Line 21: Line 19:
 called, the seed will be selected by the system. \\ called, the seed will be selected by the system. \\
 \\ \\
 +
 ''x=gen_uniform(a,b)''\\ ''x=gen_uniform(a,b)''\\
 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,1) distribution\\ +If a,b are missing, generates samples from uniform(0,1) distribution \\ 
-If a,b are real (r8), generates samples from uniform(a,b) distribution\\ +If a,b are real (r8), generates samples from uniform(a,b) distribution \\ 
-If a,b are integers, generates random integer between a and b +If a,b are integers, generates random integer between a and b \\ 
 +\\ 
 + 
 ''x=gen_normal(mean,var)''\\ ''x=gen_normal(mean,var)''\\
 mean - (r8) scalar or vector\\ mean - (r8) scalar or vector\\
Line 34: Line 34:
 Generates x=N(mean,Var) when mean and var are scalars, or  Generates x=N(mean,Var) when mean and var are scalars, or 
 x=MVN(mean,Var) when mean is a vector and Var is a matrix.  x=MVN(mean,Var) when mean is a vector and Var is a matrix. 
- 
 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)\\ 
 +\\
  
 +''x=gen_invwishart(inv_q_form,df)''\\
 +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.\\ 
 +\\
  
 +''y=normal(x)''\\
 +x - real(r8) scalar\\
 +y  - real (r8) contains density(X) for N(0,1)\\
 +\\
  
 +''y=normal_cdf(x)''\\
 +x - real (r8) scalar\\
 +y - real (r8) cumulative distribution function for N(0,1)\\
 +\\
  
- x=gen_invwishart(inv_q_form,df) +''y=normal_invcdf(x)''\\ 
-  +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>.  +
- +
-- real (r8) as in: x=normal_cdf(y) +
- +
- +
- +
-=== Gen_trunc_normal === +
- +
-y=generate_trunc_normal(a,b,mean,var) +
- +
-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=generate_trunc_normal(a,b,mean,var)''\\
 +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 <a,b>+truncated to interval <a,b>.\\ 
 +\\
 If mean and var are scalars, generates random samples from N(mean,var)  If mean and var are scalars, generates random samples from N(mean,var) 
-distribution truncated to interval <a,b>.+distribution truncated to interval <a,b>.\\
  
 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,var) distribution with first dimension truncated to interval <a,b>+MVN(mean,var) distribution with first dimension truncated to interval <a,b>.\\ 
 +\\
  
 === Other functions/subroutines === === Other functions/subroutines ===
Line 118: Line 84:
  
    
- 
prob.txt · Last modified: 2024/03/25 18:22 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki