~ubuntu-branches/ubuntu/saucy/python-scipy/saucy

« back to all changes in this revision

Viewing changes to scipy/special/cdflib/cumpoi.f

  • Committer: Bazaar Package Importer
  • Author(s): Ondrej Certik
  • Date: 2008-06-16 22:58:01 UTC
  • mfrom: (2.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080616225801-irdhrpcwiocfbcmt
Tags: 0.6.0-12
* The description updated to match the current SciPy (Closes: #489149).
* Standards-Version bumped to 3.8.0 (no action needed)
* Build-Depends: netcdf-dev changed to libnetcdf-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      SUBROUTINE cumpoi(s,xlam,cum,ccum)
 
2
C**********************************************************************
 
3
C
 
4
C     SUBROUTINE CUMPOI(S,XLAM,CUM,CCUM)
 
5
C                    CUMulative POIsson distribution
 
6
C
 
7
C
 
8
C                              Function
 
9
C
 
10
C
 
11
C     Returns the  probability  of  S   or  fewer events in  a   Poisson
 
12
C     distribution with mean XLAM.
 
13
C
 
14
C
 
15
C                              Arguments
 
16
C
 
17
C
 
18
C     S --> Upper limit of cumulation of the Poisson.
 
19
C                                                  S is DOUBLE PRECISION
 
20
C
 
21
C     XLAM --> Mean of the Poisson distribution.
 
22
C                                                  XLAM is DOUBLE PRECIS
 
23
C
 
24
C     CUM <-- Cumulative poisson distribution.
 
25
C                                        CUM is DOUBLE PRECISION
 
26
C
 
27
C     CCUM <-- Compliment of Cumulative poisson distribution.
 
28
C                                                  CCUM is DOUBLE PRECIS
 
29
C
 
30
C
 
31
C                              Method
 
32
C
 
33
C
 
34
C     Uses formula  26.4.21   of   Abramowitz and  Stegun,  Handbook  of
 
35
C     Mathematical   Functions  to reduce   the   cumulative Poisson  to
 
36
C     the cumulative chi-square distribution.
 
37
C
 
38
C**********************************************************************
 
39
C     .. Scalar Arguments ..
 
40
      DOUBLE PRECISION s,xlam,cum,ccum
 
41
C     ..
 
42
C     .. Local Scalars ..
 
43
      DOUBLE PRECISION chi,df
 
44
C     ..
 
45
C     .. External Subroutines ..
 
46
      EXTERNAL cumchi
 
47
C     ..
 
48
C     .. Executable Statements ..
 
49
      df = 2.0D0* (s+1.0D0)
 
50
      chi = 2.0D0*xlam
 
51
      CALL cumchi(chi,df,ccum,cum)
 
52
      RETURN
 
53
 
 
54
      END