forked from casact/chainladder-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_berqsherm_case.py
31 lines (26 loc) · 1.06 KB
/
plot_berqsherm_case.py
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
"""
==========================================
Berquist Sherman Case Reserve Adjustment
==========================================
This example demonstrates the adjustment to case reserves using the Berquist-Sherman
method. A key assumption, and highly sensitive one at that, is the selection of
a trend factor representative of the trend in average open case reserves from
year to year.
"""
import chainladder as cl
# Load data
triangle = cl.load_sample('berqsherm').loc['MedMal']
# Specify Berquist-Sherman model
berq = cl.BerquistSherman(
paid_amount='Paid', incurred_amount='Incurred',
reported_count='Reported', closed_count='Closed',
trend=0.15)
# Adjust our triangle data
berq_triangle = berq.fit_transform(triangle)
berq_cdf = cl.Development().fit(berq_triangle['Incurred']).cdf_
orig_cdf = cl.Development().fit(triangle['Incurred']).cdf_
# Plot the results
(berq_cdf / orig_cdf).T.plot(
kind='bar', grid=True, legend=False,
title='Berquist Sherman CDF to Unadjusted CDF').set(
xlabel='Age to Ultimate', ylabel='Case Incurred CDF Adjustment');