note 108855 rejected from function.stats-cdf-gamma by thiago

From: Date: Thu, 31 May 2012 15:35:45 +0000
Subject: note 108855 rejected from function.stats-cdf-gamma by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-188337@lists.php.net to get a copy of this message
Note Submitter: dgcowboy70 at gmail dot com ---- Hello, I needed badly this function, but there was no documentation available about it, so I dug deep into the code and found out something very interesting: stats_cdf_gamma(float par1, float par2, float par3, int which) The value of parameter “which” determines the meaning of the remaining 3 other parameters (par1,par2,par3) and the outcome of the calculation, as illustrated below: WHICH --> Integer indicating which of the next four argument values is to be calculated from the others. Legal range: 1..4 which = 1 : Calculate P and Q from X,SHAPE and SCALE which = 2 : Calculate X from P,Q,SHAPE and SCALE which = 3 : Calculate SHAPE from P,Q,X and SCALE which = 4 : Calculate SCALE from P,Q,X and SHAPE Where the meaning of P,Q,SCALE,SHAPE is given below: P <--> The integral from 0 to X of the gamma density. Input range: [0,1]. Q <--> 1-P. Input range: (0, 1]. P + Q = 1.0. X <--> The upper limit of integration of the gamma density. Input range: [0, +infinity). Search range: [0,1E100] SHAPE <--> The shape parameter of the gamma density. Input range: (0, +infinity). Search range: [1E-100,1E100] SCALE <--> The scale parameter of the gamma density. Input range: (0, +infinity). Search range: (1E-100,1E100] In summary: | which |par1 |par2 |par3 |the function returns: | | 1 |X |SHAPE |SCALE | P | | 2 |P |SHAPE |SCALE | X | | 3 |P |X |SCALE | SHAPE | | 4 |P |X |SHAPE | SCALE | I tried it for which=1 and it works fine.

« previous php.notes (#188337) next »