-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresults.txt
More file actions
515 lines (450 loc) · 30.5 KB
/
results.txt
File metadata and controls
515 lines (450 loc) · 30.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
============================================================
RUNNING ALL TESTS
============================================================
============================================================
Test 1: Poisson Distribution (Example 1 from thesis)
============================================================
Computed P(S_N = 4) = 0.0761005842
Expected P(S_N = 4) = 0.0761005842
Difference: 1.24e-11
Test PASSED: True
============================================================
Test 2: Negative Binomial Distribution (Example 2 from thesis)
============================================================
Computed P(S_N = 4) = 0.05514609309696
Expected P(S_N = 4) = 0.05514609309696
Difference: 0.00e+00
Test PASSED: True
============================================================
Test 3: Binomial Distribution (Example 3 from thesis)
============================================================
Computed P(S_N = 4) = 0.033548184000
Expected P(S_N = 4) = 0.033548184000
Difference: 0.00e+00
Test PASSED: True
============================================================
Test 4: Mixed Poisson Distribution (Example 4/6 from thesis)
============================================================
Computed P(S_N = 4) = 0.063185242224
Expected P(S_N = 4) = 0.063185242224
Difference: 1.39e-17
Test PASSED: True
============================================================
Test 5: Mixed Binomial Distribution (Example 7 from thesis)
============================================================
Computed P(S_N = 4) = 0.016361573047297504
Expected P(S_N = 4) = 0.016361573047297497
Difference: 6.94e-18
Test PASSED: True
============================================================
Test 6: Mixed Negative Binomial (Example 8 from thesis)
============================================================
Computed P(S_N = 4) = 0.056791273151484377
Expected P(S_N = 4) = 0.056791273151484377
Difference: 0.00e+00
Test PASSED: True
============================================================
Test 7: Mixed All Three Types (Example 9 from thesis)
============================================================
Computed P(S_N = 4) = 0.073043708531626381
Expected P(S_N = 4) = 0.073043708531626395
Difference: 1.39e-17
Test PASSED: True
============================================================
SUMMARY
============================================================
✓ PASSED: Example 1: Poisson
✓ PASSED: Example 2: Negative Binomial
✓ PASSED: Example 3: Binomial
✓ PASSED: Example 4/6: Mixed Poisson
✓ PASSED: Example 7: Mixed Binomial
✓ PASSED: Example 8: Mixed Neg. Binomial
✓ PASSED: Example 9: Mixed All Three
Total: 7/7 tests passed
============================================================
============================================================
Intuitive Example: Law of Total Probability (LTP)
N ~ Poisson(λ=3)
============================================================
Computed P(S_N = 4) = 0.0761005842
Expected P(S_N = 4) = 0.0761005842
Difference: 1.24e-11
Test PASSED: True
Step-by-step LTP breakdown (conditioning on N):
n=0: P(N=0)=1.000000*e^(-3), P(sum=4|N=0)=0.00000000, term=0.00000000*e^(-3)
n=1: P(N=1)=3.000000*e^(-3), P(sum=4|N=1)=0.25000000, term=0.75000000*e^(-3)
n=2: P(N=2)=4.500000*e^(-3), P(sum=4|N=2)=0.17000000, term=0.76500000*e^(-3)
n=3: P(N=3)=4.500000*e^(-3), P(sum=4|N=3)=0.00300000, term=0.01350000*e^(-3)
n=4: P(N=4)=3.375000*e^(-3), P(sum=4|N=4)=0.00000625, term=0.00002109*e^(-3)
================================================================================
CACHING BENEFIT: Recursive Method With vs. Without Memoization
N ~ Poisson(λ=3), claim distribution support {1,2,3,4,5}
'Operations' = convolution-sum multiplications (α_i × probability)
Uncached ops computed directly for k ≤ 18; beyond that
the exponential growth makes direct computation infeasible.
================================================================================
k Cached Uncached Speedup Cache entries
--------------------------------------------------------------------------------
1 1 2 2.0x 2
2 3 5 1.7x 4
3 7 11 1.6x 7
5 25 47 1.9x 16
8 82 363 4.4x 34
10 140 1,407 10.1x 51
12 214 5,441 25.4x 70
15 355 41,351 116.5x 106
18 532 314,205 590.6x 148
20 670 (too large to compute) — 181
30 1,600 (too large to compute) — 391
50 4,660 (too large to compute) — 1,051
100 19,310 (too large to compute) — 4,101
--------------------------------------------------------------------------------
Interpretation:
Each unique (value, level) pair can be reached by multiple paths
through the recursion tree. Without caching, every path recomputes
the subproblem from scratch. The number of such paths grows
exponentially (~2^k), while the number of unique pairs grows as
O(k²). Caching converts the algorithm from exponential to
polynomial time, at the cost of retaining all O(k²) cached values.
=========================================================================================================
COMPUTATION COUNT AND MEMORY SUMMARY AT k=4: All Thesis Examples
Recursive vs. Law of Total Probability
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored values (Recursive: cumulative cache; LTP: one slice)
=========================================================================================================
Example Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
-----------------------------------------------------------------------------------------------
Example 1: Poisson(λ=3) 14 19 1.36x 11 4 2.75x
Example 2: NegBin(r=6, p=0.6) 14 19 1.36x 11 4 2.75x
Example 3: Binomial(r=6, p=0.6) 14 19 1.36x 11 4 2.75x
Example 4: Mixed Poisson 14 19 1.36x 11 4 2.75x
Example 7: Mixed Binomial 14 19 1.36x 11 4 2.75x
Example 8: Mixed NegBin 14 19 1.36x 11 4 2.75x
Example 9: Mixed All Three 14 19 1.36x 11 4 2.75x
-----------------------------------------------------------------------------------------------
Key finding: all examples produce identical operation and memory counts.
The convolution-sum work depends only on the claim distribution support
{1,2,3,4,5} and the target k — not on the distribution of N. Whether
N is Poisson, Binomial, Negative Binomial, or any mixture, the recursive
method visits the same set of unique (value, level) pairs and the LTP
method performs the same n-fold convolution steps. The distribution of
N affects only the scalar weights applied at each step, not the count.
Interpretation:
Operations: Both methods are O(k²); the recursive method has a slight
constant-factor advantage at small k via memoization, converging to
the same cost as k grows.
Memory: The recursive cache is O(k²) and never freed; LTP peak
storage is O(k) — one convolution slice at a time.
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 1: Poisson(λ=3)
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 2: NegBin(r=6, p=0.6)
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 3: Binomial(r=6, p=0.6)
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 4: Mixed Poisson
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 7: Mixed Binomial
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 8: Mixed NegBin
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
COMPUTATION COUNT AND MEMORY: Example 9: Mixed All Three
'Operations' = multiplications in the core convolution sum
'Memory' = peak stored probability values (Recursive: cumulative cache; LTP: one slice)
===============================================================================================
k Rec Ops LTP Ops Op Ratio Rec Mem LTP Mem Mem Ratio
---------------------------------------------------------------------------
1 1 3 3.00x 2 1 2.00x
2 3 6 2.00x 4 2 2.00x
3 7 11 1.57x 7 3 2.33x
5 25 31 1.24x 16 5 3.20x
10 140 151 1.08x 51 9 5.67x
20 670 691 1.03x 181 17 10.65x
50 4,660 4,711 1.01x 1,051 41 25.63x
100 19,310 19,411 1.01x 4,101 81 50.63x
200 78,610 78,811 1.00x 16,201 161 100.63x
---------------------------------------------------------------------------
===============================================================================================
FULL DISTRIBUTION EFFICIENCY: Single-Pass vs. Independent Per-k Queries
N ~ Poisson(λ=3), claim distribution support {1,2,3,4,5}
Computing P(S_N = k) for all k = 0, 1, ..., K
===============================================================================================
--- Recursive --- --- LTP ---
K Independent Shared pass Savings Independent Shared pass Savings
---------------------------------------------------------------------------------------------
5 50 35 30.0% 71 41 42.3%
10 480 185 61.5% 546 191 65.0%
20 4,465 860 80.7% 4,696 851 81.9%
50 77,420 5,885 92.4% 78,746 5,711 92.7%
100 642,345 24,260 96.2% 647,496 23,411 96.4%
---------------------------------------------------------------------------------------------
Interpretation:
Independent: compute_prob(k) called separately for each k = 0..K;
the recursive cache is cleared and LTP rebuilds its convolution
table from scratch on every call.
Shared pass: compute_distribution(K) called once; the recursive
cache accumulates across all k values so subproblems solved for
smaller k are reused for larger k, and LTP builds the convolution
table once and reads off every k simultaneously.
Both methods achieve large savings with a shared pass. The recursive
savings grow because its cache depth (the level s) increases with k,
creating more overlap between successive single-point queries.
======================================================================
SIMULATION VS RECURSIVE COMPUTATION COMPARISON
======================================================================
=====================================================================================
COMPARISON: Poisson(λ=3)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0497870684 0.0497870684 0.0500700000 2.83e-04 2.83e-04
1 0.0074680603 0.0074680603 0.0071840000 2.84e-04 2.84e-04
2 0.0603045866 0.0603045866 0.0605220000 2.17e-04 2.17e-04
3 0.0239257980 0.0239257980 0.0237400000 1.86e-04 1.86e-04
4 0.0761005842 0.0761005842 0.0760920000 8.58e-06 8.58e-06
5 0.0589753033 0.0589753033 0.0589660000 9.30e-06 9.30e-06
6 0.0693898094 0.0693898094 0.0700900000 7.00e-04 7.00e-04
7 0.0675901256 0.0675901256 0.0673780000 2.12e-04 2.12e-04
8 0.0662288726 0.0662288726 0.0665500000 3.21e-04 3.21e-04
9 0.0710921248 0.0710921248 0.0710580000 3.41e-05 3.41e-05
10 0.0615539564 0.0615539564 0.0619240000 3.70e-04 3.70e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.002626 LTP: 0.002626
Max rel error Recursive: 3.80% LTP: 3.80% (over reliable k only)
Max |Rec - LTP| 2.08e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Negative Binomial(r=6, p=0.6)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0466560000 0.0466560000 0.0472220000 5.66e-04 5.66e-04
1 0.0055987200 0.0055987200 0.0055000000 9.87e-05 9.87e-05
2 0.0451816704 0.0451816704 0.0451120000 6.97e-05 6.97e-05
3 0.0174889083 0.0174889083 0.0176320000 1.43e-04 1.43e-04
4 0.0551460931 0.0551460931 0.0546400000 5.06e-04 5.06e-04
5 0.0430238270 0.0430238270 0.0427160000 3.08e-04 3.08e-04
6 0.0494478486 0.0494478486 0.0494240000 2.38e-05 2.38e-05
7 0.0486151405 0.0486151405 0.0486800000 6.49e-05 6.49e-05
8 0.0494014300 0.0494014300 0.0491200000 2.81e-04 2.81e-04
9 0.0537620926 0.0537620926 0.0540400000 2.78e-04 2.78e-04
10 0.0491638606 0.0491638606 0.0494060000 2.42e-04 2.42e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.002582 LTP: 0.002582
Max rel error Recursive: 1.76% LTP: 1.76% (over reliable k only)
Max |Rec - LTP| 6.25e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Binomial(r=6, p=0.6)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0040960000 0.0040960000 0.0041100000 1.40e-05 1.40e-05
1 0.0018432000 0.0018432000 0.0018500000 6.80e-06 6.80e-06
2 0.0150912000 0.0150912000 0.0149480000 1.43e-04 1.43e-04
3 0.0092505600 0.0092505600 0.0091000000 1.51e-04 1.51e-04
4 0.0335481840 0.0335481840 0.0335860000 3.78e-05 3.78e-05
5 0.0287931463 0.0287931463 0.0291920000 3.99e-04 3.99e-04
6 0.0540904615 0.0540904615 0.0542020000 1.12e-04 1.12e-04
7 0.0558566630 0.0558566630 0.0557440000 1.13e-04 1.13e-04
8 0.0716529954 0.0716529954 0.0712660000 3.87e-04 3.87e-04
9 0.0801124304 0.0801124304 0.0801580000 4.56e-05 4.56e-05
10 0.0827164599 0.0827164599 0.0825500000 1.66e-04 1.66e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.001574 LTP: 0.001574
Max rel error Recursive: 1.63% LTP: 1.63% (over reliable k only)
Max |Rec - LTP| 1.39e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Mixed Poisson (λ1=3, λ2=4; β=0.6, 0.4)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0371984966 0.0371984966 0.0374240000 2.26e-04 2.26e-04
1 0.0059460873 0.0059460873 0.0058260000 1.20e-04 1.20e-04
2 0.0480512859 0.0480512859 0.0483580000 3.07e-04 3.07e-04
3 0.0196401512 0.0196401512 0.0197660000 1.26e-04 1.26e-04
4 0.0631852422 0.0631852422 0.0635580000 3.73e-04 3.73e-04
5 0.0493500215 0.0493500215 0.0495420000 1.92e-04 1.92e-04
6 0.0613921137 0.0613921137 0.0612600000 1.32e-04 1.32e-04
7 0.0603086221 0.0603086221 0.0597240000 5.85e-04 5.85e-04
8 0.0616339864 0.0616339864 0.0622880000 6.54e-04 6.54e-04
9 0.0667955727 0.0667955727 0.0665500000 2.46e-04 2.46e-04
10 0.0602818846 0.0602818846 0.0606900000 4.08e-04 4.08e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.003367 LTP: 0.003367
Max rel error Recursive: 2.02% LTP: 2.02% (over reliable k only)
Max |Rec - LTP| 2.78e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Mixed Binomial (r1=8,p1=0.5; r2=10,p2=0.7; β=0.6,0.4)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0023461120 0.0023461120 0.0022700000 7.61e-05 7.61e-05
1 0.0009402556 0.0009402556 0.0008920000 4.83e-05 4.83e-05
2 0.0076875542 0.0076875542 0.0077160000 2.84e-05 2.84e-05
3 0.0045455148 0.0045455148 0.0047400000 1.94e-04 1.94e-04
4 0.0163615730 0.0163615730 0.0166380000 2.76e-04 2.76e-04
5 0.0140857701 0.0140857701 0.0139240000 1.62e-04 1.62e-04
6 0.0261684753 0.0261684753 0.0262020000 3.35e-05 3.35e-05
7 0.0273858687 0.0273858687 0.0272080000 1.78e-04 1.78e-04
8 0.0360041623 0.0360041623 0.0363240000 3.20e-04 3.20e-04
9 0.0411054717 0.0411054717 0.0414580000 3.53e-04 3.53e-04
10 0.0449594769 0.0449594769 0.0446580000 3.01e-04 3.01e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.001971 LTP: 0.001971
Max rel error Recursive: 5.13% LTP: 5.13% (over reliable k only)
Max |Rec - LTP| 6.94e-18 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Mixed Negative Binomial (r1=4,p1=0.6; r2=6,p2=0.5; β=0.5,0.5)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0726125000 0.0726125000 0.0726380000 2.55e-05 2.55e-05
1 0.0063558750 0.0063558750 0.0061480000 2.08e-04 2.08e-04
2 0.0512087391 0.0512087391 0.0510640000 1.45e-04 1.45e-04
3 0.0185167789 0.0185167789 0.0185120000 4.78e-06 4.78e-06
4 0.0567912732 0.0567912732 0.0561560000 6.35e-04 6.35e-04
5 0.0440468679 0.0440468679 0.0437760000 2.71e-04 2.71e-04
6 0.0442922630 0.0442922630 0.0439720000 3.20e-04 3.20e-04
7 0.0432434640 0.0432434640 0.0428440000 3.99e-04 3.99e-04
8 0.0421017945 0.0421017945 0.0420900000 1.18e-05 1.18e-05
9 0.0455786524 0.0455786524 0.0453920000 1.87e-04 1.87e-04
10 0.0406345022 0.0406345022 0.0413220000 6.87e-04 6.87e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.002895 LTP: 0.002895
Max rel error Recursive: 3.27% LTP: 3.27% (over reliable k only)
Max |Rec - LTP| 4.86e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
=====================================================================================
COMPARISON: Mixed All Three (Poisson + Binomial + NegBin)
Simulations: 500,000
=====================================================================================
k Recursive LTP Simulated |Rec-Sim| |LTP-Sim|
--------------------------------------------------------------------------------
0 0.0726023273 0.0726023273 0.0721860000 4.16e-04 4.16e-04
1 0.0072734741 0.0072734741 0.0072840000 1.05e-05 1.05e-05
2 0.0587172159 0.0587172159 0.0591460000 4.29e-04 4.29e-04
3 0.0230458220 0.0230458220 0.0229360000 1.10e-04 1.10e-04
4 0.0730437085 0.0730437085 0.0732880000 2.44e-04 2.44e-04
5 0.0569281774 0.0569281774 0.0568740000 5.42e-05 5.42e-05
6 0.0666305142 0.0666305142 0.0663040000 3.27e-04 3.27e-04
7 0.0650838424 0.0650838424 0.0650740000 9.84e-06 9.84e-06
8 0.0651070300 0.0651070300 0.0656940000 5.87e-04 5.87e-04
9 0.0699550724 0.0699550724 0.0698380000 1.17e-04 1.17e-04
10 0.0610303303 0.0610303303 0.0614120000 3.82e-04 3.82e-04
--------------------------------------------------------------------------------
Total abs error Recursive: 0.002686 LTP: 0.002686
Max rel error Recursive: 0.90% LTP: 0.90% (over reliable k only)
Max |Rec - LTP| 4.16e-17 (exact methods agree)
Convergence check (max rel error < 10%, reliable k only): PASSED
======================================================================
SIMULATION COMPARISON SUMMARY
======================================================================
✓ PASSED: Poisson(λ=3)
✓ PASSED: Negative Binomial(r=6, p=0.6)
✓ PASSED: Binomial(r=6, p=0.6)
✓ PASSED: Mixed Poisson (λ1=3, λ2=4; β=0.6, 0.4)
✓ PASSED: Mixed Binomial (r1=8,p1=0.5; r2=10,p2=0.7; β=0.6,0.4)
✓ PASSED: Mixed Negative Binomial (r1=4,p1=0.6; r2=6,p2=0.5; β=0.5,0.5)
✓ PASSED: Mixed All Three (Poisson + Binomial + NegBin)
Total: 7/7 comparisons passed
======================================================================