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
Next revisionBoth sides next revision
prob [2012/11/16 12:08] ignacyprob [2012/12/06 18:41] ignacy
Line 1: Line 1:
-=====Module Prob===== +======Module Prob====== 
- +Ignacy Misztal and Deukhwan Lee, University of Georgia \\ 
- +04/29/99-04/19/2001 \\
- +
-  +
-Ignacy Misztal and Deukhwan Lee, University of Georgia +
-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 18: Line 11:
  
 Module prob uses high-quality generators from public domain package RANLIB for Module prob uses high-quality generators from public domain package RANLIB for
-random number generators. Some low level code is from Luis Varona.+random number generators. Some low level code is from Luis Varona.\\
  
 +==== Subroutines/functions==== 
  
 +''call set_seed(n)'' \\
 +Sets seed for random number generator to integer n. If this subroutine is not
 +called, the seed will be selected by the system. \\
 +\\
  
-=== Module Prob === +''x=gen_uniform(a,b)''\\ 
- +a,b - both real (r*) or both integers or both missing.\\ 
- +If a,b are missing, generates samples from uniform(0,1) distribution. \\ 
-=== Set_seed === +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. \\ 
- +\\ 
-call set_seed(n) +  
- +''x=gen_normal(mean,var)''\\ 
-n - integer +mean - (r8) scalar or vector\\ 
- +var  - (r8) scalar or square matrix\\ 
-Sets seed for random number generator to value n. If this subroutine is not +x    - (r8) scalar or square matrix\\
-called, the seed will be selected by the system.  +
- +
- +
- +
-=== Gen_uniform === +
- +
- +
- +
-x=gen_uniform(a,b) +
- +
-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 real (r8), generates samples from uniform(a,b) distribution.  +
- +
-If a,b are integers, generates random integer between a and b.  +
- +
- +
- +
-=== Gen_normal === +
- +
-x    - gen_normal(mean,var) +
- +
-mean - (r8) scalar or vector +
- +
-var  - (r8) scalar or square matrix +
- +
-x    - (r8) scalar or square matrix+
  
 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)\\ 
 +\\
  
  
-=== Gen_invwishart === +''x=gen_invwishart(inv_q_form,df)''
- +
- +
- +
- x=gen_invwishart(inv_q_form,df)+
    
-inv_q_form - (r8) scalar or square matrix containing inverse of quadratic form+inv_q_form - (r8) scalar or square matrix containing inverse of quadratic form\\ 
 +df         - an integer containing degrees of freedom\\
  
-df         - an integer containing degrees of freedom+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)\\
 +\\
  
-Generates samples from inverted chi square or inverted Wishart distributions. +''y=normal_cdf(x)''\\ 
- +x - real (r8) scalar\\ 
- +y - real (r8) cumulative distribution function for N(0,1)\\ 
- +\\
-=== 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) y=normal_invcdf(x)
  
-x - real (r8) scalar in the range of <0,1>+x - real (r8) scalar in the range of <0,1>\\ 
 +y - real (r8) as in: x=normal_cdf(y)\\ 
 +\\
  
-- real (r8) as in: x=normal_cdf(y)+''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\\
  
-=== Gen_trunc_normal === +var - real(r8) variance or covariance matrix, optional if scalar\\ 
- +\\
-y=generate_trunc_normal(a,b,mean,var+
- +
-- 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 +
 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 149: Line 90:
  
    
- 
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