Post Reply 
(25) Poisson Distribution
12-24-2017, 12:20 PM (This post was last modified: 12-24-2017 12:58 PM by Dieter.)
Post: #2
RE: (25) Poisson Distribution
(12-23-2017 06:39 PM)SlideRule Wrote:  extracted from Matematisk Institutt (MAR, 1977) Avd.C by Erling Sverdrup

First of all: This seems to be the Erling Sverdrup who has an own article on Wikipedia:
Quote:Erling Sverdrup (23 February 1917 – 15 March 1994) was a Norwegian statistician and actuarial mathematician. He played an instrumental role in building up and modernising the fields of mathematical statistics and actuarial science in Norway, primarily at the Department of Mathematics at the University of Oslo but also via his links to Statistics Norway.

So "Matematisk Institutt" is the department of mathematics / math sciences at the university of Oslo. "Avd. C" is short for "avdeling C" which simply means "department C".

The idea of rescaling exp(-λ) to prevent underflow is nice, but the implementation of the first program leaves room for improvments. Forty years later, here is another version that implements the same idea and works with the exact threshold (ln 1E99) instead of 227.

Code:
01  STO 3
02  X<>Y
03  STO 2
04  EEX
05  9
06  9
07  LN
08  X>=Y?
09  X<>Y
10  CHS
11  e^x
12  STO 0
13  CLX
14  STO 1
15  STO 4
16  RCL 0
17  STO+1
18  RCL 3
19  RCL 4
20  x>=y?
21  GTO 29
22  1
23  STO+4
24  RCL 2
25  RCL 4
26  /
27  STOx0
28  GTO 16
29  EEX
30  9
31  9
32  LN
33  RCL 2
34  -
35  X>=0?
36  CLX
37  e^x
38  STOx0
39  STOx1
40  RCL 0
41  RCL 1

Input:  λ [ENTER] k
Output X: cumulative distribution function P(x≤k)
Output Y: probability mass function P(x=k)

Registers:
R0: PMF
R1: CDF
R2: λ
R3: k
R4: x=0...k

Example:

f [PRGM]  f [FIX] 4

4,68 [ENTER] 5
[R/S]  => 0,6719
[X↔Y] => 0,1736

240 [ENTER] 10
[R/S]  => 1,0717063 E–87
[X↔Y] => 1,0272443 E–87

450 [ENTER] 450
[R/S]  => 0,5125
[X↔Y] => 0,0188

Both results can also be recalled from R1 or R0 respectively.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(25) Poisson Distribution - SlideRule - 12-23-2017, 06:39 PM
RE: (25) Poisson Distribution - Dieter - 12-24-2017 12:20 PM



User(s) browsing this thread: 1 Guest(s)