runnerjp Posted February 3, 2016 Share Posted February 3, 2016 know in excel to Calculate poisson probability percentage i just use =POISSON( 2, 3.55, FALSE) but is there a similar thing I can use in php as i have found http://php.net/manual/en/function.stats-cdf-poisson.php but it has no documentation to use it Quote Link to comment Share on other sites More sharing options...
requinix Posted February 3, 2016 Share Posted February 3, 2016 I'm going to copy/paste from the source: /********************************************************************** 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,1E100] XLAM <--> Mean of the Poisson distribution. Input range: [0, +infinity). Search range: [0,1E100] 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. **********************************************************************/If $which == 1,- $par1 is the S value - $par2 is the XLAM value If $which == 2, - $par1 is the P value (and Q is 1-P) - $par2 is the XLAM value If $which == 3, - $par1 is the S value - $par2 is the P value (and Q is 1-P) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.