-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathestimators.html
More file actions
1672 lines (1500 loc) · 112 KB
/
estimators.html
File metadata and controls
1672 lines (1500 loc) · 112 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
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Reserve Estimators — trikit 0.3.3 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Sample Datasets" href="datasets.html" />
<link rel="prev" title="Incremental and Cumulative Triangle Objects" href="triangle.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> trikit
</a>
<div class="version">
0.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="overview.html">Project Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="triangle.html">Triangles</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Estimators</a></li>
<li class="toctree-l1"><a class="reference internal" href="datasets.html">Sample Datasets</a></li>
<li class="toctree-l1"><a class="reference internal" href="lrdb.html">CAS Loss Reserving Database</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorial/correlated.html">Correlated Reserve Indications</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial/smoothing.html">Smoothing Loss Development Patterns</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">trikit</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li>Reserve Estimators</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/estimators.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="reserve-estimators">
<span id="estimators"></span><h1>Reserve Estimators<a class="headerlink" href="#reserve-estimators" title="Permalink to this headline">¶</a></h1>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Refer to the <a class="reference internal" href="quickstart.html#quickstart"><span class="std std-ref">Quickstart Guide</span></a> for invocation examples.</p>
</div>
<dl class="py class">
<dt id="trikit.estimators.base.BaseChainLadder">
<em class="property">class </em><code class="sig-name descname">BaseChainLadder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cumtri</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder" title="Permalink to this definition">¶</a></dt>
<dd><p>From the Casualty Actuarial Society’s <em>Estimating Unpaid Claims Using
Basic Techniques</em> Version 3 (Friedland, Jacqueline - 2010), the
development method (‘Chain Ladder’) consists of seven basic steps:</p>
<ol class="arabic simple">
<li><p>Compile claims data in a development triangle.</p></li>
<li><p>Calculate age-to-age factors.</p></li>
<li><p>Calculate averages of the age-to-age factors.</p></li>
<li><p>Select claim development factors.</p></li>
<li><p>Select tail factor.</p></li>
<li><p>Calculate cumulative claims.</p></li>
<li><p>Project ultimate claims.</p></li>
</ol>
<p>The BaseChainLadder class encapsulates logic to perform steps 1-7.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cumtri</strong> (<a class="reference internal" href="triangle.html#trikit.triangle.CumTriangle" title="trikit.triangle.CumTriangle"><em>trikit.triangle.CumTriangle</em></a>) – A cumulative triangle instance.</p>
</dd>
</dl>
<p class="rubric">References</p>
<ol class="arabic simple">
<li><p>Friedland, J., <em>Estimating Unpaid Claims Using Basic Techniques</em>,
Casualty Actuarial Society, 2010.</p></li>
</ol>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadder._cldfs">
<code class="sig-name descname">_cldfs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldfs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder._cldfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder._cldfs" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate cumulative loss development factors by successive
multiplication beginning with the tail factor and the oldest
age-to-age factor. The cumulative claim development factor projects
the total growth over the remaining valuations. Cumulative claim
development factors are also known as “Age-to-Ultimate Factors”
or “Claim Development Factors to Ultimate”.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ldfs</strong> (<em>pd.Series</em>) – Selected ldfs, typically the output of calling <code class="docutils literal notranslate"><span class="pre">self._ldfs</span></code>.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadder._ldfs">
<code class="sig-name descname">_ldfs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sel</span><span class="o">=</span><span class="default_value">'all-weighted'</span></em>, <em class="sig-param"><span class="n">tail</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder._ldfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder._ldfs" title="Permalink to this definition">¶</a></dt>
<dd><p>Lookup loss development factors corresponding to <code class="docutils literal notranslate"><span class="pre">sel</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>sel</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The ldf average to select from <code class="docutils literal notranslate"><span class="pre">triangle._CumTriangle.a2a_avgs</span></code>.
Defaults to “all-weighted”.</p></li>
<li><p><strong>tail</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Tail factor. Defaults to 1.0.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadder._reserves">
<code class="sig-name descname">_reserves</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ultimates</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder._reserves"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder._reserves" title="Permalink to this definition">¶</a></dt>
<dd><p>Return IBNR/reserve estimates by origin and in aggregate. Represents
the difference between ultimate projections for each origin period
and the latest cumulative value.
Since outstanding claim liabilities can be referred to differently
based on the type of losses represented in the triangle (“ibnr” if
reported/incurred, “unpaid” if paid losses), we use the general term
“reserve” to represent the difference between ultimate projections
and latest cumulative value by origin and in total.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ultimates</strong> (<em>pd.Series</em>) – Estimated ultimate losses, conventionally obtained from
BaseChainLadder’s <code class="docutils literal notranslate"><span class="pre">_ultimates</span></code> method.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadder._trisqrd">
<code class="sig-name descname">_trisqrd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldfs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder._trisqrd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder._trisqrd" title="Permalink to this definition">¶</a></dt>
<dd><p>Project claims growth for each future development period. Returns a
DataFrame of loss projections for each subsequent development period
for each origin period. Populates the triangle’s lower-right or
southeast portion (i.e., the result of “squaring the triangle”).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ldfs</strong> (<em>pd.Series</em>) – Selected ldfs, typically the output of calling <code class="docutils literal notranslate"><span class="pre">self._ldfs</span></code>.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadder._ultimates">
<code class="sig-name descname">_ultimates</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cldfs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadder._ultimates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadder._ultimates" title="Permalink to this definition">¶</a></dt>
<dd><p>Ultimate claims are equal to the product of the latest valuation of
losses (the amount along latest diagonal of any <code class="docutils literal notranslate"><span class="pre">_CumTriangle</span></code>
instance) and the appropriate cldf/age-to-ultimate factor. We
determine the appropriate age-to-ultimate factor based on the age
of each origin year relative to the evaluation date.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cldfs</strong> (<em>pd.Series</em>) – Cumulative loss development factors, conventionally obtained
via BaseChainLadder’s <code class="docutils literal notranslate"><span class="pre">_cldfs</span></code> method.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="trikit.estimators.base.BaseChainLadderResult">
<em class="property">class </em><code class="sig-name descname">BaseChainLadderResult</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">summary</span></em>, <em class="sig-param"><span class="n">tri</span></em>, <em class="sig-param"><span class="n">sel</span></em>, <em class="sig-param"><span class="n">ldfs</span></em>, <em class="sig-param"><span class="n">tail</span></em>, <em class="sig-param"><span class="n">trisqrd</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadderResult"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadderResult" title="Permalink to this definition">¶</a></dt>
<dd><p>Container object for BaseChainLadder output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>summary</strong> (<em>pd.DataFrame</em>) – Chain Ladder summary compilation.</p></li>
<li><p><strong>tri</strong> (<em>trikit.triangle._CumTriangle</em>) – A cumulative triangle instance.</p></li>
<li><p><strong>sel</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em> or </em><em>array_like</em>) – Reference to loss development selection. If ldf overrides are
utilized, <code class="docutils literal notranslate"><span class="pre">sel</span></code> will be identical to <code class="docutils literal notranslate"><span class="pre">ldfs</span></code>.</p></li>
<li><p><strong>ldfs</strong> (<em>pd.Series</em>) – Loss development factors.</p></li>
<li><p><strong>tail</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Tail factor. Defaults to 1.0.</p></li>
<li><p><strong>trisqrd</strong> (<em>pd.DataFrame</em>) – Projected claims growth for each future development period.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadderResult._data_transform">
<code class="sig-name descname">_data_transform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadderResult._data_transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadderResult._data_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Transform dataset for use in FacetGrid plot by origin exhibting chain
ladder reserve estimates.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadderResult._get_yticks">
<em class="property">static </em><code class="sig-name descname">_get_yticks</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadderResult._get_yticks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadderResult._get_yticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Determine y axis tick labels for a given maximum loss amount x.
Return tuple of tick values and ticklabels.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Maximum value for a given origin period.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple of ndarrays</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.base.BaseChainLadderResult.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">actuals_color</span><span class="o">=</span><span class="default_value">'#334488'</span></em>, <em class="sig-param"><span class="n">forecasts_color</span><span class="o">=</span><span class="default_value">'#FFFFFF'</span></em>, <em class="sig-param"><span class="n">axes_style</span><span class="o">=</span><span class="default_value">'darkgrid'</span></em>, <em class="sig-param"><span class="n">context</span><span class="o">=</span><span class="default_value">'notebook'</span></em>, <em class="sig-param"><span class="n">col_wrap</span><span class="o">=</span><span class="default_value">4</span></em>, <em class="sig-param"><span class="n">hue_kws</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">exhibit_path</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/base.html#BaseChainLadderResult.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.base.BaseChainLadderResult.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Visualize actual losses along with projected chain ladder development.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>actuals_color</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A color name or hexidecimal code used to represent actual
observations. Defaults to “#00264C”.</p></li>
<li><p><strong>forecasts_color</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A color name or hexidecimal code used to represent forecast
observations. Defaults to “#FFFFFF”.</p></li>
<li><p><strong>axes_style</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Aesthetic style of plots. Defaults to “darkgrid”. Other options
include: {whitegrid, dark, white, ticks}.</p></li>
<li><p><strong>context</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Set the plotting context parameters. According to the seaborn
documentation, This affects things like the size of the labels,
lines, and other elements of the plot, but not the overall style.
Defaults to “notebook”. Additional options include
{“paper”, “talk”, “poster”}.</p></li>
<li><p><strong>col_wrap</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The maximum number of origin period axes to have on a single row
of the resulting FacetGrid. Defaults to 5.</p></li>
<li><p><strong>hue_kws</strong> (<em>dictionary of param:list of values mapping</em>) – Other keyword arguments to insert into the plotting call to let
other plot attributes vary across levels of the hue variable
(e.g. the markers in a scatterplot). Each list of values should
have length 2, with each index representing aesthetic
overrides for forecasts and actuals respectively. Defaults to
<code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li>
<li><p><strong>exhibit_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Path to which exhibit should be written. If None, exhibit will be
rendered via <code class="docutils literal notranslate"><span class="pre">plt.show()</span></code>.</p></li>
<li><p><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)"><em>dict</em></a>) – Additional styling options for scatter points. This can override
default values for <code class="docutils literal notranslate"><span class="pre">plt.plot</span></code> objects. For a demonstration,
See the Examples section.</p></li>
</ul>
</dd>
</dl>
<p class="rubric">Examples</p>
<p>Demonstration of passing a dictionary of plot properties in order
to update the scatter size and marker:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">In</span> <span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="kn">import</span> <span class="nn">trikit</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">2</span><span class="p">]:</span> <span class="n">tri</span> <span class="o">=</span> <span class="n">trikit</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">dataset</span><span class="o">=</span><span class="s2">"raa"</span><span class="p">,</span> <span class="n">tri_type</span><span class="o">=</span><span class="s2">"cum"</span><span class="p">)</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">3</span><span class="p">]:</span> <span class="n">cl</span> <span class="o">=</span> <span class="n">tri</span><span class="o">.</span><span class="n">base_cl</span><span class="p">(</span><span class="n">sel</span><span class="o">=</span><span class="s2">"all-weighted"</span><span class="p">,</span> <span class="n">tail</span><span class="o">=</span><span class="mf">1.005</span><span class="p">)</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">4</span><span class="p">]:</span> <span class="n">kwds</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">marker</span><span class="o">=</span><span class="s2">"s"</span><span class="p">,</span> <span class="n">markersize</span><span class="o">=</span><span class="mi">6</span><span class="p">)</span>
<span class="n">In</span> <span class="p">[</span><span class="mi">5</span><span class="p">]:</span> <span class="n">cl</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="o">**</span><span class="n">kwds</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="trikit.estimators.mack.MackChainLadder">
<em class="property">class </em><code class="sig-name descname">MackChainLadder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cumtri</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder" title="Permalink to this definition">¶</a></dt>
<dd><p>Mack Chain Ladder estimator. The predicition variance is comprised
of the estimation variance and the process variance. Estimation variance
arises from the inability to accurately define the distribution from which
past events have been generated. Process variance arises from the
inability to accurately predict which single outcome from the distribution
will occur at a given time. The predicition error is defined as the
standard deviation of the forecast.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cumtri</strong> (<em>triangle._CumTriangle</em>) – A cumulative.CumTriangle instance</p>
</dd>
</dl>
<p class="rubric">References</p>
<ol class="arabic simple">
<li><p>Mack, Thomas (1993) <em>Measuring the Variability of Chain Ladder Reserve
Estimates</em>, 1993 CAS Prize Paper Competition on Variability of Loss Reserves.</p></li>
<li><p>Mack, Thomas, (1993), <em>Distribution-Free Calculation of the Standard Error
of Chain Ladder Reserve Estimates</em>, ASTIN Bulletin 23, no. 2:213-225.</p></li>
<li><p>Mack, Thomas, (1999), <em>The Standard Error of Chain Ladder Reserve Estimates:
Recursive Calculation and Inclusion of a Tail Factor</em>, ASTIN Bulletin 29,
no. 2:361-366.</p></li>
<li><p>England, P., and R. Verrall, (2002), <em>Stochastic Claims Reserving in General Insurance</em>, British Actuarial Journal 8(3): 443-518.</p></li>
<li><p>Murphy, Daniel, (2007), <em>Chain Ladder Reserve Risk Estimators</em>, CAS E-Forum, Summer 2007.</p></li>
<li><p>Carrato, A., McGuire, G. and Scarth, R. 2016. <em>A Practitioner’s
Introduction to Stochastic Reserving</em>, The Institute and Faculty of
Actuaries. 2016.</p></li>
</ol>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._devp_variance">
<code class="sig-name descname">_devp_variance</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldfs</span></em>, <em class="sig-param"><span class="n">alpha</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._devp_variance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._devp_variance" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the development period variance, usually represented as
<img class="math" src="_images/math/12a0d588be6f8c7d0fa558071b7bbf4066d07054.png" alt="\hat{\sigma}^{2}_{k}"/> in the literature. For a triangle with
n development periods, result will contain n-1 elements.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>ldfs</strong> (<em>pd.Series</em>) – <dl class="simple">
<dt>Selected ldfs, typically the output of calling <code class="docutils literal notranslate"><span class="pre">self._ldfs</span></code>, or a series</dt><dd><p>of values indexed by development period.</p>
</dd>
<dt>alpha: {0, 1, 2}</dt><dd><ul class="simple">
<li><p>0: Straight average of observed individual link ratios.</p></li>
<li><p>1: Historical Chain Ladder age-to-age factors.</p></li>
<li><p>2: Regression of <img class="math" src="_images/math/1bead0a08cdab1fe3f2a736e1f8415d92471d75a.png" alt="C_{k+1}"/> on <img class="math" src="_images/math/e3abe42aff12d2540074535c8e20e3664471401d.png" alt="C_{k}"/> with 0 intercept.</p></li>
</ul>
</dd>
</dl>
</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._ldf_variance">
<code class="sig-name descname">_ldf_variance</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">devpvar</span></em>, <em class="sig-param"><span class="n">alpha</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._ldf_variance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._ldf_variance" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the variance of a given development period’s link ratios
w.r.t. selected ldfs.</p>
<dl class="simple">
<dt>devpvar: pd.Series</dt><dd><p>The development period variance, usually represented as
<img class="math" src="_images/math/12a0d588be6f8c7d0fa558071b7bbf4066d07054.png" alt="\hat{\sigma}^{2}_{k}"/> in the literature. For a triangle with
n development periods, devpvar will contain n-1 elements.</p>
</dd>
<dt>alpha: {0, 1, 2}</dt><dd><ul class="simple">
<li><p>0: Straight average of observed individual link ratios.</p></li>
<li><p>1: Historical Chain Ladder age-to-age factors.</p></li>
<li><p>2: Regression of :math`C_{k+1}` on :math: <cite>C_{k}</cite> with 0 intercept.</p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._ldfs">
<code class="sig-name descname">_ldfs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">alpha</span><span class="o">=</span><span class="default_value">1</span></em>, <em class="sig-param"><span class="n">tail</span><span class="o">=</span><span class="default_value">1.0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._ldfs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._ldfs" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute Mack loss development factors.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>alpha</strong> (<em>{0</em><em>, </em><em>1</em><em>, </em><em>2}</em>) – <ul>
<li><p>0: Straight average of observed individual link ratios.</p></li>
<li><p>1: Historical Chain Ladder age-to-age factors.</p></li>
<li><p>2: Regression of <img class="math" src="_images/math/1bead0a08cdab1fe3f2a736e1f8415d92471d75a.png" alt="C_{k+1}"/> on <img class="math" src="_images/math/e3abe42aff12d2540074535c8e20e3664471401d.png" alt="C_{k}"/> with 0 intercept.</p></li>
</ul>
</p></li>
<li><p><strong>tail</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Tail factor. At present, must be 1.0. This may change in a future release.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._mean_squared_error">
<code class="sig-name descname">_mean_squared_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">process_error</span></em>, <em class="sig-param"><span class="n">parameter_error</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._mean_squared_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._mean_squared_error" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the mean squared error of reserve estimates for each
origin period. The standard error for each origin period
is the square root of the mean squared error.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>process_error</strong> (<em>pd.Series</em>) – Reserve estimate process error indexed by origin. Represents the
risk associated with the projection of future contingencies that
are inherently variable, even if the parameters are known
with certainty.</p></li>
<li><p><strong>parameter_error</strong> (<em>pd.Series</em>) – Reserve estimate parameter error indexed by origin. Represents
the risk that the parameters used in the methods or models are not
representative of future outcomes.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.Series</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._parameter_error">
<code class="sig-name descname">_parameter_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldfs</span></em>, <em class="sig-param"><span class="n">ldfvar</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._parameter_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._parameter_error" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a triangle-shaped DataFrame containing elementwise parameter
error. To obtain the parameter error for a given origin period,
cells are aggregated across columns.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ldfs</strong> (<em>pd.Series</em>) – Selected ldfs, typically the output of calling <code class="docutils literal notranslate"><span class="pre">self._ldfs</span></code>,
or a series of values indexed by development period.</p></li>
<li><p><strong>ldfvar</strong> (<em>pd.Series</em>) – Link ratio variance. For a triangle with n development
periods, ldfvar will contain n-1 elements.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder._process_error">
<code class="sig-name descname">_process_error</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ldfs</span></em>, <em class="sig-param"><span class="n">devpvar</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadder._process_error"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder._process_error" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a triangle-shaped DataFrame containing elementwise process
error. To obtain the process error for a given origin period,
cells are aggregated across columns.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>ldfs</strong> (<em>pd.Series</em>) – Selected ldfs, typically the output of calling <code class="docutils literal notranslate"><span class="pre">self._ldfs</span></code>,
or a series of values indexed by development period.</p></li>
<li><p><strong>devpvar</strong> (<em>pd.Series</em>) – The development period variance, usually represented as
<img class="math" src="_images/math/12a0d588be6f8c7d0fa558071b7bbf4066d07054.png" alt="\hat{\sigma}^{2}_{k}"/> in the literature. For a triangle with
n development periods, devpvar will contain n-1 elements.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder.mod_a2aind">
<em class="property">property </em><code class="sig-name descname">mod_a2aind</code><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder.mod_a2aind" title="Permalink to this definition">¶</a></dt>
<dd><p>Return self.tri.a2aind with lower right 0s replaced with NaN.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadder.mod_tri">
<em class="property">property </em><code class="sig-name descname">mod_tri</code><a class="headerlink" href="#trikit.estimators.mack.MackChainLadder.mod_tri" title="Permalink to this definition">¶</a></dt>
<dd><p>Return modified triangle-shaped DataFrame with same indices as <code class="docutils literal notranslate"><span class="pre">self.tri.a2a</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="trikit.estimators.mack.MackChainLadderResult">
<em class="property">class </em><code class="sig-name descname">MackChainLadderResult</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">summary</span></em>, <em class="sig-param"><span class="n">tri</span></em>, <em class="sig-param"><span class="n">alpha</span></em>, <em class="sig-param"><span class="n">tail</span></em>, <em class="sig-param"><span class="n">ldfs</span></em>, <em class="sig-param"><span class="n">trisqrd</span></em>, <em class="sig-param"><span class="n">dist</span></em>, <em class="sig-param"><span class="n">process_error</span></em>, <em class="sig-param"><span class="n">parameter_error</span></em>, <em class="sig-param"><span class="n">devpvar</span></em>, <em class="sig-param"><span class="n">ldfvar</span></em>, <em class="sig-param"><span class="n">rvs</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult" title="Permalink to this definition">¶</a></dt>
<dd><p>Container class for <code class="docutils literal notranslate"><span class="pre">MackChainLadder</span></code> output.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>summary</strong> (<em>pd.DataFrame</em>) – <code class="docutils literal notranslate"><span class="pre">MackChainLadder</span></code> summary.</p></li>
<li><p><strong>tri</strong> (<a class="reference internal" href="triangle.html#trikit.triangle.CumTriangle" title="trikit.triangle.CumTriangle"><em>trikit.triangle.CumTriangle</em></a>) – A cumulative triangle instance.</p></li>
<li><p><strong>alpha</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – MackChainLadder alpha parameter.</p></li>
<li><p><strong>tail</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Tail factor.</p></li>
<li><p><strong>ldfs</strong> (<em>pd.Series</em>) – Loss development factors.</p></li>
<li><p><strong>trisqrd</strong> (<em>pd.DataFrame</em>) – Projected claims growth for each future development period.</p></li>
<li><p><strong>dist</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The distribution function chosen to approximate the true distribution of
reserves by origin period. Wither “norm” or “lognorm”.</p></li>
<li><p><strong>process_error</strong> (<em>pd.Series</em>) – Reserve estimate process error indexed by origin. Represents the
risk associated with the projection of future contingencies that
are inherently variable, even if parameters are known with certainty.</p></li>
<li><p><strong>parameter_error</strong> (<em>pd.Series</em>) – Reserve estimate parameter error indexed by origin. Represents
the risk that the parameters used in the methods or models are not
representative of future outcomes.</p></li>
<li><p><strong>devpvar</strong> (<em>pd.Series</em>) – The development period variance, usually represented as
<img class="math" src="_images/math/12a0d588be6f8c7d0fa558071b7bbf4066d07054.png" alt="\hat{\sigma}^{2}_{k}"/> in the literature. For a triangle having
n development periods, <code class="docutils literal notranslate"><span class="pre">devpvar</span></code> will contain n-1
elements.</p></li>
<li><p><strong>ldfvar</strong> (<em>pd.Series</em>) – Variance of age-to-age factors. Required for Murphy’s recursive
estimator of parameter risk. For a triangle having n
development periods, <code class="docutils literal notranslate"><span class="pre">ldfvar</span></code> will contain n-1 elements.</p></li>
<li><p><strong>rvs</strong> (<em>pd.Series</em>) – Series indexed by origin containing Scipy frozen random variable
with parameters mu and sigma having distribution specified by
<code class="docutils literal notranslate"><span class="pre">dist</span></code>.</p></li>
<li><p><strong>kwargs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)"><em>dict</em></a>) – Additional parameters originally passed into <code class="docutils literal notranslate"><span class="pre">MackChainLadder</span></code>’s
<code class="docutils literal notranslate"><span class="pre">__call__</span></code> method.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._cy_effects_table">
<code class="sig-name descname">_cy_effects_table</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._cy_effects_table"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._cy_effects_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Construct a tabular summary of values used in assessing the presence of
significant calendar year influences in the set of age-to-age factors.
Resulting DataFrame contains the following columns:</p>
<ul class="simple">
<li><dl class="simple">
<dt>j:</dt><dd><p>The diagonal in question. For a triangle with n periods, j ranges
from 2 to n - 1. The most recent diagonal is associated with
j = n - 1.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>S:</dt><dd><p>Represents the number of small age-to-age factors for a given
diagonal. Recall that small age-to-age factors are those less
than the median for a given development period.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>L:</dt><dd><p>Represents the number of large age-to-age factors for a given
diagonal. Recall that large age-to-age factors are those greater
than the median for a given development period.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>Z:</dt><dd><p>For a given j, <img class="math" src="_images/math/fbe26d3feb387ddc2c6bfdf79449381d59bc50fc.png" alt="Z = min(S, L)"/>.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>n:</dt><dd><p>For a given j, is defined as <img class="math" src="_images/math/7695306a8b36dc4a0daf5313669b83d67ae5ad61.png" alt="S + L"/>.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>m:</dt><dd><p>For a given j, is defined as <img class="math" src="_images/math/86d56efba50d50a45372eb3262507e845b7753a5.png" alt="floor([n - 1] / 2)"/>.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>E_Z:</dt><dd><p>For a given j, is defined as <img class="math" src="_images/math/ae855d4a7bd2833ef4b85e7ea2a176d57b1e810b.png" alt="\frac{n}{2} - \binom{n-1}{m} \times \frac{n}{2^{n}}"/>.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>V_Z:</dt><dd><p>For a given j, is defined as
<img class="math" src="_images/math/1bd0df38f950a21a2cb17883917c9293e57ff9c9.png" alt="\frac{n(n-1)}{4} - \binom{n-1}{m} \times \frac{n(n-1)}{2^{n}} + \mu - \mu^{2}"/>.</p>
</dd>
</dl>
</li>
</ul>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._devp_corr_test_var">
<code class="sig-name descname">_devp_corr_test_var</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._devp_corr_test_var"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._devp_corr_test_var" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the variance used in the development period correlation test.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)">float</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._mack_data_transform">
<code class="sig-name descname">_mack_data_transform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._mack_data_transform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._mack_data_transform" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate data by origin period and in total to plot estimated reserve distributions.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._residuals_by_devp">
<code class="sig-name descname">_residuals_by_devp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._residuals_by_devp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._residuals_by_devp" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate standardized residuals by development period.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._residuals_by_origin">
<code class="sig-name descname">_residuals_by_origin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._residuals_by_origin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._residuals_by_origin" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate standardized residuals by origin period.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._spearman_corr_coeffs">
<code class="sig-name descname">_spearman_corr_coeffs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._spearman_corr_coeffs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._spearman_corr_coeffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the Spearman correlation coefficients for each pair of equal
sized columns from <code class="docutils literal notranslate"><span class="pre">self.tri._ranked_a2a</span></code>.</p>
<p>For adjacent columns, a Spearman coefficient close to 0 indicates that
the development factors between development years k - 1 and k and
those between developmenr years k and k+1 are uncorrelated. Any
other value of <img class="math" src="_images/math/973106ec7cfb5ed094373f7168dc10df07e33140.png" alt="T_{k}"/> indicates that the factors are positively or
negatively correlated.</p>
<p>In the resulting DataFrame, columns are defined as:</p>
<blockquote>
<div><ul class="simple">
<li><dl class="simple">
<dt>k:</dt><dd><p>An enumeration of the target development period.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>w:</dt><dd><p>Quanity used to weight the Spearman coefficient, specified
as n - k - 1, where n is the number of origin periods
in the triangle.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>T_k:</dt><dd><p>Spearman correlation coefficient. Defined as <img class="math" src="_images/math/9887577875412878f03cdfa845046e1b8572c869.png" alt="T_{k} = 1 - 6 \sum_{i=1}^{n-k}"/>.</p>
</dd>
</dl>
</li>
</ul>
</div></blockquote>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p></p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>pd.DataFrame</p>
</dd>
</dl>
<p class="rubric">References</p>
<p>1. Mack, Thomas (1993) <em>Measuring the Variability of Chain Ladder Reserve
Estimates</em>, 1993 CAS Prize Paper Competition on Variability of Loss Reserves.</p>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult._spearman_corr_total">
<code class="sig-name descname">_spearman_corr_total</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult._spearman_corr_total"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult._spearman_corr_total" title="Permalink to this definition">¶</a></dt>
<dd><p>Weighted average of each adjacent column’s Spearman coefficient
from <code class="docutils literal notranslate"><span class="pre">self._spearman_corr_coeffs</span></code>. Correlation coefficients are weighted
by</p>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult.cy_effects_test">
<code class="sig-name descname">cy_effects_test</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">p</span><span class="o">=</span><span class="default_value">0.05</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult.cy_effects_test"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult.cy_effects_test" title="Permalink to this definition">¶</a></dt>
<dd><p>We reject the hypothesis, with an error probability of p, of having no
significant calendar year effects only if not:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">E_Z</span> <span class="o">-</span> <span class="mf">1.96</span> <span class="o">*</span> <span class="n">sqrt</span><span class="p">(</span><span class="n">V_Z</span><span class="p">)</span> <span class="o"><=</span> <span class="n">Z</span> <span class="o"><=</span> <span class="n">E_Z</span> <span class="o">+</span> <span class="mf">1.96</span> <span class="o">*</span> <span class="n">sqrt</span><span class="p">(</span><span class="n">V_Z</span><span class="p">)</span> <span class="p">(</span><span class="k">if</span> <span class="n">p</span> <span class="o">=</span> <span class="mf">.05</span><span class="p">)</span>
</pre></div>
</div>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Significance level with which to perform test for calendar year
effects. Test is two-sided (see above).</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)">tuple</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult.devp_corr_test">
<code class="sig-name descname">devp_corr_test</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">p</span><span class="o">=</span><span class="default_value">0.5</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult.devp_corr_test"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult.devp_corr_test" title="Permalink to this definition">¶</a></dt>
<dd><p>Significance test to assess the degree of development period correlation.
The first element of the returned tuple contains the upper and lower
bounds of the test interval. The second element represents the test
statistic, the weighted average of Spearman rank correlation coefficients.
If the test statistic falls within the range bounded by the first element,
the null hypothesis of having uncorrelated development factors is not
rejected. If the test statistic falls outside the interval, development
period correlations should be analyzed in greater detail.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>p</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Represents the central normal interval outside of which
development factors are assumed to exhibit some degree of
correlation.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)">tuple</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult.diagnostics">
<code class="sig-name descname">diagnostics</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult.diagnostics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult.diagnostics" title="Permalink to this definition">¶</a></dt>
<dd><p>Statistical diagnostics plots of Mack Chain Ladder estimator.
Exhibit is a faceted quad plot, representing the estimated
reserve distribution, the path to ultimate for each origin period,
and residuals by origin and development period.</p>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult.get_quantiles">
<code class="sig-name descname">get_quantiles</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">q</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult.get_quantiles"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult.get_quantiles" title="Permalink to this definition">¶</a></dt>
<dd><p>Get quantiles of estimated reserve distribution for an individual origin periods and
in total. Returns a DataFrame, with columns representing the percentiles of interest.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>q</strong> (<em>array_like of float</em><em> or </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#float" title="(in Python v3.9)"><em>float</em></a>) – Quantile or sequence of quantiles to compute, which must be between 0 and 1
inclusive.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pd.DataFrame</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="trikit.estimators.mack.MackChainLadderResult.plot">
<code class="sig-name descname">plot</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">q</span><span class="o">=</span><span class="default_value">0.95</span></em>, <em class="sig-param"><span class="n">dist_color</span><span class="o">=</span><span class="default_value">'#000000'</span></em>, <em class="sig-param"><span class="n">q_color</span><span class="o">=</span><span class="default_value">'#E02C70'</span></em>, <em class="sig-param"><span class="n">axes_style</span><span class="o">=</span><span class="default_value">'darkgrid'</span></em>, <em class="sig-param"><span class="n">context</span><span class="o">=</span><span class="default_value">'notebook'</span></em>, <em class="sig-param"><span class="n">col_wrap</span><span class="o">=</span><span class="default_value">4</span></em>, <em class="sig-param"><span class="n">exhibit_path</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/mack.html#MackChainLadderResult.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.mack.MackChainLadderResult.plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot estimated reserve distribution by origin year and in total.
The mean of the reserve estimate will be highlighted, along with
and quantiles specified in <code class="docutils literal notranslate"><span class="pre">q</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>q</strong> (<em>float in range of</em><em> [</em><em>0</em><em>,</em><em>1</em><em>]</em>) – The quantile to highlight, which must be between 0 and 1 inclusive.</p></li>
<li><p><strong>dist_color</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Color or hexidecimal color code of estimated reserve distribution.</p></li>
<li><p><strong>q_color</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Color or hexidecimal color code of estimated reserve mean
and quantiles.</p></li>
<li><p><strong>axes_style</strong> (<em>{"darkgrid"</em><em>, </em><em>"whitegrid"</em><em>, </em><em>"dark"</em><em>, </em><em>"white"</em><em>, </em><em>"ticks"}</em>) – Aesthetic style of seaborn plots. Default values is “darkgrid”.</p></li>
<li><p><strong>context</strong> (<em>{"notebook"</em><em>, </em><em>"paper"</em><em>, </em><em>"talk"</em><em>, </em><em>"poster"}.</em>) – Set the plotting context parameters. According to the seaborn
documentation, This affects things like the size of the labels,
lines, and other elements of the plot, but not the overall style.
Default value is “notebook”.</p></li>
<li><p><strong>col_wrap</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The maximum number of origin period axes to have on a single row
of the resulting FacetGrid. Defaults to 5.</p></li>
<li><p><strong>exhibit_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – Path to which exhibit should be written. If None, exhibit will be
rendered via <code class="docutils literal notranslate"><span class="pre">plt.show()</span></code>.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="trikit.estimators.bootstrap.BootstrapChainLadder">
<em class="property">class </em><code class="sig-name descname">BootstrapChainLadder</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cumtri</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/trikit/estimators/bootstrap.html#BootstrapChainLadder"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#trikit.estimators.bootstrap.BootstrapChainLadder" title="Permalink to this definition">¶</a></dt>
<dd><p>The purpose of the bootstrap technique is to estimate the predicition
error of the total reserve estimate and to approximate the predictive
distribution. It is often impractical to obtain the prediction error
using an analytical approach due to the complexity of reserve estimators.</p>
<p>Predicition error is comprised of two components: process error
and estimation error (Prediction Error = Estimation Error + Process Error).
The estimation error (parameter error) represents the uncertainty in the
parameter estimates given that the model is correctly specified. The
process error is analogous to the variance of a random variable,
representing the uncertainty in future outcomes.</p>
<p>The procedure used to generate the predicitive distribution of reserve
estimates is based on Leong et al. Appendix A, assuming the starting point
is a triangle of cumulative losses:</p>
<ol class="arabic simple">
<li><p>Calculate the all-year volume-weighted age-to-age factors.</p></li>
<li><p>Estimate the fitted historical cumulative paid loss and ALAE
using the latest diagonal of the original triangle and the
age-to-age factors from [1] to un-develop the losses.</p></li>
<li><p>Calculate the unscaled Pearson residuals, degrees of freedom
and scale parameter.</p></li>
<li><p>Calculate the adjusted Pearson residuals.</p></li>
<li><p>Sample with replacement from the adjusted Pearson residuals.</p></li>
<li><p>Calculate the triangle of sampled incremental losses
(I^ = m + r_adj * sqrt(m)), where I^ = Resampled incremental loss,
m = Incremental fitted loss (from [2]) and r_adj = Adjusted Pearson
residuals.</p></li>
<li><p>Using the triangle from [6], project future losses using the
Chain Ladder method.</p></li>
<li><p>Include Process variance by simulating each incremental future
loss from a Gamma distribution with mean = I^ and
variance = I^ * scale parameter.</p></li>
<li><p>Estimate unpaid losses using the Chain Ladder technique.</p></li>
<li><p>Repeat for the number of cycles specified.</p></li>
</ol>
<p>The collection of projected ultimates for each origin year over all
bootstrap cycles comprises the predictive distribtuion of reserve
estimates.
Note that the estimate of the distribution of losses assumes
development is complete by the final development period. This is
to avoid the complication associated with modeling a tail factor.</p>
<p class="rubric">References</p>
<ol class="arabic simple">
<li><p>England, P., and R. Verrall, (2002), <em>Stochastic Claims Reserving in General
Insurance</em>, British Actuarial Journal 8(3): 443-518.</p></li>
<li><p>CAS Working Party on Quantifying Variability in Reserve Estimates,
<em>The Analysis and Estimation of Loss & ALAE Variability: A Summary Report</em>,
Casualty Actuarial Society Forum, Fall 2005.</p></li>
<li><p>Leong et al., (2012), <em>Back-Testing the ODP Bootstrap of the Paid
Chain-Ladder Model with Actual Historical Claims Data</em>, Casualty Actuarial
Society E-Forum.</p></li>
<li><p>Kirschner, et al., <em>Two Approaches to Calculating Correlated Reserve
Indications Across Multiple Lines of Business</em> Appendix III, Variance
Journal, Volume 2/Issue 1.</p></li>