Doxygen Source Code Documentation
cdf_26.c
Go to the documentation of this file.00001 #include "cdflib.h" 00002 void cumbin(double *s,double *xn,double *pr,double *ompr, 00003 double *cum,double *ccum) 00004 /* 00005 ********************************************************************** 00006 00007 void cumbin(double *s,double *xn,double *pr,double *ompr, 00008 double *cum,double *ccum) 00009 00010 CUmulative BINomial distribution 00011 00012 00013 Function 00014 00015 00016 Returns the probability of 0 to S successes in XN binomial 00017 trials, each of which has a probability of success, PBIN. 00018 00019 00020 Arguments 00021 00022 00023 S --> The upper limit of cumulation of the binomial distribution. 00024 S is DOUBLE PRECISION 00025 00026 XN --> The number of binomial trials. 00027 XN is DOUBLE PRECISIO 00028 00029 PBIN --> The probability of success in each binomial trial. 00030 PBIN is DOUBLE PRECIS 00031 00032 OMPR --> 1 - PBIN 00033 OMPR is DOUBLE PRECIS 00034 00035 CUM <-- Cumulative binomial distribution. 00036 CUM is DOUBLE PRECISI 00037 00038 CCUM <-- Compliment of Cumulative binomial distribution. 00039 CCUM is DOUBLE PRECIS 00040 00041 00042 Method 00043 00044 00045 Formula 26.5.24 of Abramowitz and Stegun, Handbook of 00046 Mathematical Functions (1966) is used to reduce the binomial 00047 distribution to the cumulative beta distribution. 00048 00049 ********************************************************************** 00050 */ 00051 { 00052 static double T1,T2; 00053 /* 00054 .. 00055 .. Executable Statements .. 00056 */ 00057 if(!(*s < *xn)) goto S10; 00058 T1 = *s+1.0e0; 00059 T2 = *xn-*s; 00060 cumbet(pr,ompr,&T1,&T2,ccum,cum); 00061 goto S20; 00062 S10: 00063 *cum = 1.0e0; 00064 *ccum = 0.0e0; 00065 S20: 00066 return; 00067 } /* END */