Implementing Panjer’s Recurrence Formula to Calculate the Exact Distribution of S
The following SAS program implements Panjer’s Recurrence Formula to calculate the exact distribution for the total claim value for a compound Poisson distribution with a given Poisson parameter value and a loss distribution given as a set of probabilities for loss amounts taking on positive integer values. With suitable modification, the program may also be used to calculate the exact distribution for the total claim value for a compound binomial distribution.
The example implemented here is Example 3.6 on page 89 of the textbook.
The SAS program is listed first, followed by the results (which are given using “put” statements and appear in the SAS log of the program. Note that both the p.m.f. and the c.d.f. of the distribution of S are given.
SAS Program:
data one;
input lambda;
dummy = 1;
put"The Poisson parameter is " lambda ".";
cards;
3
;
data two;
array x{9} x1-x9;
array y{9} y1-y9;
arrayfx{9} fx1-fx9;
lossunit = 100;
doi = 1to9;
input y(i);
end;
put"P.M.F. for the Loss Distribution";
doi = 1to9;
fx(i) = 1/9;
x(i) = y(i)/lossunit;
put"For x = " y(i) ", f(x) = "fx(i);
end;
dummy = 1;
cards;
100
200
300
400
500
600
700
800
900
;
datathree;merge one two; by dummy;
array s{31} s1-s31;
array fs{31} fs1 - fs31;
array CDFs{31} CDFs1 - CDFs31;
arrayfx{9} fx1-fx9;
put"The units of measurement for the loss distribution: "lossunit".";
fn0 = exp(-lambda);
s(1) = 0;
fs(1) = fn0;
doi = 2to31;
fs(i) = 0;
end;
doi = 2to31;
k = min(i-1, 9);
do j = 1to k;
fs(i) = fs(i) + (lambda*j/(i-1))*fx(j)*fs(i-j);
end;
s(i) = (i-1)*lossunit;
end;
CDFs(1) = fs(1);
doi = 2to31;
CDFs(i) = CDFs(i-1)+fs(i);
end;
put"Distribution of S, including p.m.f. and c.d.f.";
doi = 1to31;
put"For s = " s(i) ", fs = " fs(i) ", and Fs = " CDFs(i) ".";
end;
drop dummy x1-x9 fx1-fx9 lossunit;
;
run;
Results:
NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.4 (TS1M0)
Licensed to UNIVERSITY OF NORTH FLORIDA - SFA T&R, Site 70080095.
NOTE: This session is executing on the X64_7PRO platform.
NOTE: Updated analytical products:
SAS/STAT 12.3 (maintenance)
SAS/ETS 12.3 (maintenance)
SAS/OR 12.3 (maintenance)
SAS/IML 12.3 (maintenance)
SAS/QC 12.3 (maintenance)
NOTE: Additional host information:
X64_7PRO WIN 6.1.7601 Service Pack 1 Workstation
NOTE: SAS initialization used:
real time 0.60 seconds
cpu time 0.51 seconds
1 data one;
2 input lambda;
3 dummy = 1;
4 put "The Poisson parameter is " lambda ".";
5 cards;
The Poisson parameter is 3 .
NOTE: The data set WORK.ONE has 1 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
7 ;
8 data two;
9 array x{9} x1-x9;
10 array y{9} y1-y9;
11 array fx{9} fx1-fx9;
12 lossunit = 100;
13 do i = 1 to 9;
14 input y(i);
15 end;
16 put "P.M.F. for the Loss Distribution";
17 do i = 1 to 9;
18 fx(i) = 1/9;
19 x(i) = y(i)/lossunit;
20 put "For x = " y(i) ", f(x) = " fx(i);
21 end;
22 dummy = 1;
23 cards;
P.M.F. for the Loss Distribution
For x = 100 , f(x) = 0.1111111111
For x = 200 , f(x) = 0.1111111111
For x = 300 , f(x) = 0.1111111111
For x = 400 , f(x) = 0.1111111111
For x = 500 , f(x) = 0.1111111111
For x = 600 , f(x) = 0.1111111111
For x = 700 , f(x) = 0.1111111111
For x = 800 , f(x) = 0.1111111111
For x = 900 , f(x) = 0.1111111111
NOTE: The data set WORK.TWO has 1 observations and 30 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
33 ;
34 data three;merge one two; by dummy;
35 array s{31} s1-s31;
36 array fs{31} fs1 - fs31;
37 array CDFs{31} CDFs1 - CDFs31;
38 array fx{9} fx1-fx9;
39 put "The units of measurement for the loss distribution: " lossunit ".";
40 fn0 = exp(-lambda);
41 s(1) = 0;
42 fs(1) = fn0;
43 do i = 2 to 31;
44 fs(i) = 0;
45 end;
46 do i = 2 to 31;
47 k = min(i-1, 9);
48 do j = 1 to k;
49 fs(i) = fs(i) + (lambda*j/(i-1))*fx(j)*fs(i-j);
50 end;
51 s(i) = (i-1)*lossunit;
52 end;
53 CDFs(1) = fs(1);
54 do i = 2 to 31;
55 CDFs(i) = CDFs(i-1)+fs(i);
56 end;
57 put "Distribution of S, including p.m.f. and c.d.f.";
58 do i = 1 to 31;
59 put "For s = " s(i) ", fs = " fs(i) ", and Fs = " CDFs(i) ".";
60 end;
61 drop dummy x1-x9 fx1-fx9 lossunit;
62 ;
63 run;
The units of measurement for the loss distribution: 100 .
Distribution of S, including p.m.f. and c.d.f.
For s = 0 , fs = 0.0497870684 , and Fs = 0.0497870684 .
For s = 100 , fs = 0.0165956895 , and Fs = 0.0663827578 .
For s = 200 , fs = 0.0193616377 , and Fs = 0.0857443955 .
For s = 300 , fs = 0.0224349135 , and Fs = 0.108179309 .
For s = 400 , fs = 0.0258411276 , and Fs = 0.1340204366 .
For s = 500 , fs = 0.0296075978 , and Fs = 0.1636280344 .
For s = 600 , fs = 0.0337634445 , and Fs = 0.197391479 .
For s = 700 , fs = 0.0383396896 , and Fs = 0.2357311685 .
For s = 800 , fs = 0.0433693604 , and Fs = 0.2791005289 .
For s = 900 , fs = 0.0488875992 , and Fs = 0.3279881281 .
For s = 1000 , fs = 0.0383360874 , and Fs = 0.3663242155 .
For s = 1100 , fs = 0.0394140265 , and Fs = 0.4057382421 .
For s = 1200 , fs = 0.0401778328 , and Fs = 0.4459160749 .
For s = 1300 , fs = 0.0405698597 , and Fs = 0.4864859346 .
For s = 1400 , fs = 0.0405266637 , and Fs = 0.5270125983 .
For s = 1500 , fs = 0.0399785791 , and Fs = 0.5669911774 .
For s = 1600 , fs = 0.0388492658 , and Fs = 0.6058404432 .
For s = 1700 , fs = 0.0370552319 , and Fs = 0.6428956751 .
For s = 1800 , fs = 0.0345053283 , and Fs = 0.6774010034 .
For s = 1900 , fs = 0.0311002142 , and Fs = 0.7085012176 .
For s = 2000 , fs = 0.0294977404 , and Fs = 0.7379989581 .
For s = 2100 , fs = 0.0277364905 , and Fs = 0.7657354486 .
For s = 2200 , fs = 0.0258426937 , and Fs = 0.7915781423 .
For s = 2300 , fs = 0.0238490037 , and Fs = 0.815427146 .
For s = 2400 , fs = 0.0217952198 , and Fs = 0.8372223658 .
For s = 2500 , fs = 0.019729064 , and Fs = 0.8569514298 .
For s = 2600 , fs = 0.0177070179 , and Fs = 0.8746584477 .
For s = 2700 , fs = 0.0157952233 , and Fs = 0.890453671 .
For s = 2800 , fs = 0.01407045 , and Fs = 0.904524121 .
For s = 2900 , fs = 0.0126211353 , and Fs = 0.9171452563 .
For s = 3000 , fs = 0.0112411712 , and Fs = 0.9283864274 .
NOTE: There were 1 observations read from the data set WORK.ONE.
NOTE: There were 1 observations read from the data set WORK.TWO.
NOTE: The data set WORK.THREE has 1 observations and 107 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds