~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to routines/dcd/cumpoi.f

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

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