Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

cdf_32.c

Go to the documentation of this file.
00001 #include "cdflib.h"
00002 void cumnbn(double *s,double *xn,double *pr,double *ompr,
00003             double *cum,double *ccum)
00004 /*
00005 **********************************************************************
00006  
00007      void cumnbn(double *s,double *xn,double *pr,double *ompr,
00008             double *cum,double *ccum)
00009 
00010                     CUmulative Negative BINomial distribution
00011  
00012  
00013                               Function
00014  
00015  
00016      Returns the probability that it there will be S or fewer failures
00017      before there are XN successes, with each binomial trial having
00018      a probability of success PR.
00019  
00020      Prob(# failures = S | XN successes, PR)  =
00021                         ( XN + S - 1 )
00022                         (            ) * PR^XN * (1-PR)^S
00023                         (      S     )
00024  
00025  
00026                               Arguments
00027  
00028  
00029      S --> The number of failures
00030                                                   S is DOUBLE PRECISION
00031  
00032      XN --> The number of successes
00033                                                   XN is DOUBLE PRECISIO
00034  
00035      PR --> The probability of success in each binomial trial.
00036                                                   PR is DOUBLE PRECISIO
00037  
00038      OMPR --> 1 - PR
00039                                                   OMPR is DOUBLE PRECIS
00040  
00041      CUM <-- Cumulative negative binomial distribution.
00042                                                   CUM is DOUBLE PRECISI
00043  
00044      CCUM <-- Compliment of Cumulative negative binomial distribution.
00045                                                   CCUM is DOUBLE PRECIS
00046  
00047  
00048                               Method
00049  
00050  
00051      Formula  26.5.26    of   Abramowitz  and    Stegun,  Handbook   of
00052      Mathematical   Functions (1966) is   used  to reduce the  negative
00053      binomial distribution to the cumulative beta distribution.
00054  
00055 **********************************************************************
00056 */
00057 {
00058 static double T1;
00059 /*
00060      ..
00061      .. Executable Statements ..
00062 */
00063     T1 = *s+1.e0;
00064     cumbet(pr,ompr,xn,&T1,cum,ccum);
00065     return;
00066 } /* END */
 

Powered by Plone

This site conforms to the following standards: