1+ import chainladder as cl
2+ import sys
3+
4+ from faslr .demos .sample_db import set_sample_db
5+
6+ from faslr .methods .benktander import (
7+ BenktanderWidget
8+ )
9+
10+ import pandas as pd
11+
12+ from faslr .utilities import (
13+ load_sample ,
14+ table_from_tri ,
15+ auto_bi_olep
16+ )
17+
18+ from PyQt6 .QtWidgets import (
19+ QApplication
20+ )
21+
22+ set_sample_db ()
23+
24+ app = QApplication (sys .argv )
25+
26+ averages = pd .DataFrame (
27+ data = [
28+ [True , "7-year Straight" , "Straight" , "7" ],
29+ [False , "7-year Excl. High/Low" , "Medial" , '7' ],
30+ [False , "3-year Straight" , "Straight" , "3" ],
31+ [False , "5-year Straight" , "Straight" , "5" ],
32+ ],
33+ columns = ["Selected" , "Label" , "Type" , "Number of Years" ]
34+ )
35+
36+
37+
38+ triangle = load_sample ('xyz' )
39+ reported = triangle ['Reported Claims' ]
40+ paid = triangle ['Paid Claims' ]
41+
42+ reported_ult = cl .TailConstant (tail = 1 ).fit_transform (cl .Development (n_periods = 2 , average = 'volume' ).fit_transform (reported ))
43+ reported_ult = cl .Chainladder ().fit (reported_ult )
44+
45+ paid_ult = cl .TailConstant (tail = 1.010 ,decay = 1 ).fit_transform (cl .Development (n_periods = 2 , average = 'volume' ).fit_transform (paid ))
46+ paid_ult = cl .Chainladder ().fit (paid_ult )
47+
48+ widget = BenktanderWidget (
49+ triangles = [reported_ult , paid_ult ],
50+ premium = auto_bi_olep ,
51+ averages = averages
52+ )
53+ widget .show ()
54+
55+ app .exec ()
0 commit comments