Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
SAS Functions Useful For Probability Computations N. D. Prabhakar General Motors Corporation The first argument for each of these INTRODUCTION: functions is a numeric code which specifies the particular This paper describes a group of eight SAS functions that are being developed, which can evaluate, the following eignt functions or qUBntities associated with a univariate probability distribution : CDF PDF CHF MGF CDFINV RAWMMT CNTIJIIMT RNll>1 ~ of probability distributions. For example, a code of 1 means a binomial distribution, a code of 50 means a normal distribution and a code of 102 means a Poisson sum of binomial distributions. A partial list of codes and types is shown in table 1 the oumulative distribution function, the probability densit,y function, the characteristic function, the moment ~nerating function, the inverse of the cumulative distribution function The next group of arguments for these functions specif.y the parameters of the particular type of distribution and thereey a unique probability distribution on the real line. The actual number of parameters and their meaning depend on the type specified by the first ar~ment of the functions. For instance, the parameters for the binomial distribution are the number of trials (n) and the chance for success in a trial (p), whereas the parameters for the normal distribution are the mean and variance. The parameters are seperated by commas and must appear in their correct order. Table 1 shows the parameters for the different ~pes and their meaning. (percentage points). the raw moments, the central moments, a random observation from the distribution. The probability distributions for which the above functions can be evaluated will include a wide class of distributions such as (1) basic discrete and continuous distributions - e.g. binomial, poisson, hypergeometric, negative binomial, logarithmic series, normal, lognormal, cauchy, uniform, exponential, €f3l1lID3., chisquare, Student's t, Beta, Fisher's F, Weibullj (2) random sum distributions of some basic discrete distributions - e.g. poisson sum binomial, binomdal sum poisson etc; (3) certain compound distributions where the base distribution is discrete e.g. Neyman's type A; (4) certain noncentral continuous distributions - e.g. noncentral t, F, chi-square. The last.argwrnent for each function is a number a. Given the ~pe and parameters, one has a specific probabili~ distribution on the real line. Let X be a random variable with this distrib~tion. Then the value returned Qy CDF is the probability P(X<=a). The value returned by PDF is f(a) where f is the probabili~ (densi~) runction of X. The value returned b,y CHF is the complex number E(exp( -1 aX where E stands for the expected value. The value renlrnerl by MGF is E(exp(~ X)). The value returned by CDFINV is the smallest value b such that P(X<=b) = a. The value returned by RAWMMT is E(X**a) and that returned ey CNTlMMT is E( (X-E(X))**a). The function FUNCTIONS: RNDM returns a random observation from the distribution of X, using a seed of a, where appropriate. The eignt SAS :unctions called CDF, PDF, CHF, MGF, CDFllW, RAWMMT, CNTIMMT and RNIM will compute the cumulative distribution function, the probability density function, the characteristic fUnction, the moment generating function, the inverse of the cumulative distribution function, the raw moment, the central moments and a random observation respectively for the distribution specified among the arguments for the functions. The performance characteristics of the algorithms used for the function evaluations are currently being studied. CONCLUSION: ComputatiOns involving distribution functiOns, percentage pOints etc. of various univariate distributions arise ver,y frequent~ in areas of applied probability suet as queueing theory, reliability thco~ etc. Also random observatiOns from different univariate distrib~tions are required for use in simulation studies. In such contexts, the above SAS fUnctions can be useful in aLl@Il8nting the currently existing probability and random number generating functions of SAS. 016 REFffiENCE: SAS User's Guide: Basics (1982) SAS Institute Inc., Cary, NC. Collected Algorithms, ACM Vol 1 ,2,3 Tables of the F & related distributions with algorithms. K. V. Mardia & P. J. Zemroch Academic Press, 1978 Formulae & tables for Statistical work. Ed. by HaD, Mitra, MathRi, Ramamurt~'1Y Statistical Publishing Society, 1975 For fUrther ionformation please contact: General Motors Corporation Dr. N.D. Prabhakar 485 W. Milwaukee A-104D Detroit, Mi 48202 (313) 556-3148 TYPE CODE Binomial Hypergeometric Poisson Negative Binomial Logarithmic Series 1 2 3 4 n,p N,M,n m n,p p m, ' b+b 5 50 51 m, , 52 a,b 53 .,b 54 55 n,_ 56 m 57 m 58 m,n 59 m,n 100 N,c,k,p pH 102 m,k.p Normal Lognorma.l Cauchy Uniform Exponential Gamma Chisquare Student's t Beta Fisher's F MEANIYG OR DENSITY FUNCTION PARAMETERS • 202 ',0 noncent ral chisq. 300 m,a pp Doncentral t 301 m,a noncentral F 302 m,a,n number of trials,chance of success C(M,x)*C(N-M,n-x)/C(N,n) [m**x]*exp(-m)/m! C(n-x+l.x)*[p**x]/[(l+p)**(n+x)1 -(p**x]/[x*log(l-p)] mean,s.d. log(y) where y is normal m.s a/[pi*(a*a+«x-b)**2)] 1/ (b-a) a*exp(-a*x) [(a**n)(x**(n-l»exp(-a*x)]/gamma(n) degrees of freedom degrees of freedom [(x**(m-l»«l-x)**(n-l»]/beta(m,n) numerator, denominator d.f. sum of n binomial k,p where n is binomial N,~ sum of n binomial k.p where n is poisson m poisson m where m/c is poisson a degrees of freedom, noncentrality parameter y/sqrt(z/m) where y is normal a,l and z is chisquare m (y/m)/(z/n) where y is noncentral chisquare m,a ann z is chisquare n 817