diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /math/bevington/pbinom.f | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'math/bevington/pbinom.f')
-rw-r--r-- | math/bevington/pbinom.f | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/math/bevington/pbinom.f b/math/bevington/pbinom.f new file mode 100644 index 00000000..325f6f70 --- /dev/null +++ b/math/bevington/pbinom.f @@ -0,0 +1,26 @@ +c function pbinom.f +c +c source +c Bevington, page 31. +c +c purpose +c evaluate binomial probability coefficient +c +c usage +c result = pbinom (nobs, ntotal, prob) +c +c description of parameters +c nobs - number of items observed +c ntotal - total number of items +c prob - probability of observing each item +c +c subroutines and function subprograms required +c factor (n) +c calculates n factorial for integers +c + function pbinom (nobs,ntotal,prob) +1 notobs=ntotal-nobs +2 pbinom=factor(ntotal)/(factor(nobs)*factor(notobs))* + * (prob**nobs)*(1.-prob)**notobs + return + end |