⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dcdflib.fdoc

📁 unix环境下计算符合常用概率分布的随机变量的集合
💻 FDOC
📖 第 1 页 / 共 3 页
字号:
/**********************************************************************      void cdfnbn(int *which,double *p,double *q,double *s,double *xn,	          double *pr,double *ompr,int *status,double *bound)               Cumulative Distribution Function               Negative BiNomial distribution                              Function     Calculates any one parameter of the negative binomial     distribution given values for the others.     The  cumulative  negative   binomial  distribution  returns  the     probability that there  will be  F or fewer failures before  the     XNth success in binomial trials each of which has probability of     success PR.     The individual term of the negative binomial is the probability of     S failures before XN successes and is          Choose( S, XN+S-1 ) * PR^(XN) * (1-PR)^S                              Arguments     WHICH --> Integer indicating which of the next four argument               values is to be calculated from the others.               Legal range: 1..4               iwhich = 1 : Calculate P and Q from S,XN,PR and OMPR               iwhich = 2 : Calculate S from P,Q,XN,PR and OMPR               iwhich = 3 : Calculate XN from P,Q,S,PR and OMPR               iwhich = 4 : Calculate PR and OMPR from P,Q,S and XN     P <--> The cumulation from 0 to S of the  negative            binomial distribution.            Input range: [0,1].     Q <--> 1-P.            Input range: (0, 1].            P + Q = 1.0.     S <--> The upper limit of cumulation of the binomial distribution.            There are F or fewer failures before the XNth success.            Input range: [0, +infinity).            Search range: [0, 1E300]     XN  <--> The number of successes.              Input range: [0, +infinity).              Search range: [0, 1E300]     PR  <--> The probability of success in each binomial trial.              Input range: [0,1].              Search range: [0,1].     OMPR  <--> 1-PR              Input range: [0,1].              Search range: [0,1]              PR + OMPR = 1.0     STATUS <-- 0 if calculation completed correctly               -I if input parameter number I is out of range                1 if answer appears to be lower than lowest                  search bound                2 if answer appears to be higher than greatest                  search bound                3 if P + Q .ne. 1                4 if PR + OMPR .ne. 1     BOUND <-- Undefined if STATUS is 0               Bound exceeded by parameter number I if STATUS               is negative.               Lower search bound if STATUS is 1.               Upper search bound if STATUS is 2.                              Method     Formula   26.5.26   of   Abramowitz  and  Stegun,  Handbook   of     Mathematical Functions (1966) is used  to  reduce calculation of     the cumulative distribution  function to that of  an  incomplete     beta.     Computation of other parameters involve a seach for a value that     produces  the desired  value  of P.   The search relies  on  the     monotinicity of P with the other parameter.**********************************************************************//**********************************************************************      void cdfnor(int *which,double *p,double *q,double *x,	          double *mean,double *sd,int *status,double *bound)               Cumulative Distribution Function               NORmal distribution                              Function     Calculates any one parameter of the normal     distribution given values for the others.                              Arguments     WHICH  --> Integer indicating  which of the  next  parameter     values is to be calculated using values  of the others.     Legal range: 1..4               iwhich = 1 : Calculate P and Q from X,MEAN and SD               iwhich = 2 : Calculate X from P,Q,MEAN and SD               iwhich = 3 : Calculate MEAN from P,Q,X and SD               iwhich = 4 : Calculate SD from P,Q,X and MEAN     P <--> The integral from -infinity to X of the normal density.            Input range: (0,1].     Q <--> 1-P.            Input range: (0, 1].            P + Q = 1.0.     X < --> Upper limit of integration of the normal-density.             Input range: ( -infinity, +infinity)     MEAN <--> The mean of the normal density.               Input range: (-infinity, +infinity)     SD <--> Standard Deviation of the normal density.             Input range: (0, +infinity).     STATUS <-- 0 if calculation completed correctly               -I if input parameter number I is out of range                1 if answer appears to be lower than lowest                  search bound                2 if answer appears to be higher than greatest                  search bound                3 if P + Q .ne. 1     BOUND <-- Undefined if STATUS is 0               Bound exceeded by parameter number I if STATUS               is negative.               Lower search bound if STATUS is 1.               Upper search bound if STATUS is 2.                              Method     A slightly modified version of ANORM from     Cody, W.D. (1993). "ALGORITHM 715: SPECFUN - A Portabel FORTRAN     Package of Special Function Routines and Test Drivers"     acm Transactions on Mathematical Software. 19, 22-32.     is used to calulate the  cumulative standard normal distribution.     The rational functions from pages  90-95  of Kennedy and Gentle,     Statistical  Computing,  Marcel  Dekker, NY,  1980 are  used  as     starting values to Newton's Iterations which compute the inverse     standard normal.  Therefore no  searches  are necessary for  any     parameter.     For X < -15, the asymptotic expansion for the normal is used  as     the starting value in finding the inverse standard normal.     This is formula 26.2.12 of Abramowitz and Stegun.                              Note      The normal density is proportional to      exp( - 0.5 * (( X - MEAN)/SD)**2)**********************************************************************//**********************************************************************      void cdfpoi(int *which,double *p,double *q,double *s,	          double *xlam,int *status,double *bound)               Cumulative Distribution Function               POIsson distribution                              Function     Calculates any one parameter of the Poisson     distribution given values for the others.                              Arguments     WHICH --> Integer indicating which  argument               value is to be calculated from the others.               Legal range: 1..3               iwhich = 1 : Calculate P and Q from S and XLAM               iwhich = 2 : Calculate A from P,Q and XLAM               iwhich = 3 : Calculate XLAM from P,Q and S        P <--> The cumulation from 0 to S of the poisson density.               Input range: [0,1].        Q <--> 1-P.               Input range: (0, 1].               P + Q = 1.0.        S <--> Upper limit of cumulation of the Poisson.               Input range: [0, +infinity).               Search range: [0,1E300]     XLAM <--> Mean of the Poisson distribution.               Input range: [0, +infinity).               Search range: [0,1E300]     STATUS <-- 0 if calculation completed correctly               -I if input parameter number I is out of range                1 if answer appears to be lower than lowest                  search bound                2 if answer appears to be higher than greatest                  search bound                3 if P + Q .ne. 1     BOUND <-- Undefined if STATUS is 0               Bound exceeded by parameter number I if STATUS               is negative.               Lower search bound if STATUS is 1.               Upper search bound if STATUS is 2.                              Method     Formula   26.4.21  of   Abramowitz  and   Stegun,   Handbook  of     Mathematical Functions (1966) is used  to reduce the computation     of  the cumulative distribution function to that  of computing a     chi-square, hence an incomplete gamma function.     Cumulative  distribution function  (P) is  calculated  directly.     Computation of other parameters involve a seach for a value that     produces  the desired value of  P.   The  search relies  on  the     monotinicity of P with the other parameter.**********************************************************************//**********************************************************************      void cdft(int *which,double *p,double *q,double *t,double *df,	        int *status,double *bound)               Cumulative Distribution Function                         T distribution                              Function     Calculates any one parameter of the t distribution given     values for the others.                              Arguments     WHICH --> Integer indicating which  argument               values is to be calculated from the others.               Legal range: 1..3               iwhich = 1 : Calculate P and Q from T and DF               iwhich = 2 : Calculate T from P,Q and DF               iwhich = 3 : Calculate DF from P,Q and T        P <--> The integral from -infinity to t of the t-density.               Input range: (0,1].        Q <--> 1-P.               Input range: (0, 1].               P + Q = 1.0.        T <--> Upper limit of integration of the t-density.               Input range: ( -infinity, +infinity).               Search range: [ -1E300, 1E300 ]        DF <--> Degrees of freedom of the t-distribution.                Input range: (0 , +infinity).                Search range: [1e-300, 1E10]     STATUS <-- 0 if calculation completed correctly               -I if input parameter number I is out of range                1 if answer appears to be lower than lowest                  search bound                2 if answer appears to be higher than greatest                  search bound                3 if P + Q .ne. 1     BOUND <-- Undefined if STATUS is 0               Bound exceeded by parameter number I if STATUS               is negative.               Lower search bound if STATUS is 1.               Upper search bound if STATUS is 2.                              Method     Formula  26.5.27  of   Abramowitz   and  Stegun,   Handbook   of     Mathematical Functions  (1966) is used to reduce the computation     of the cumulative distribution function to that of an incomplete     beta.     Computation of other parameters involve a seach for a value that     produces  the desired  value  of P.   The search relies  on  the     monotinicity of P with the other parameter.**********************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -