-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/casact/chainladder-python
- Loading branch information
Showing
131 changed files
with
1,831 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+202 Bytes
(100%)
docs/auto_examples/images/sphx_glr_plot_bootstrap_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-926 Bytes
(99%)
docs/auto_examples/images/sphx_glr_plot_triangle_from_pandas_001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+14.6 KB
docs/auto_examples/images/thumb/sphx_glr_plot_bootstrap_comparison_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-185 Bytes
(99%)
docs/auto_examples/images/thumb/sphx_glr_plot_bootstrap_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.6 KB
docs/auto_examples/images/thumb/sphx_glr_plot_exposure_triangle_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.2 KB
docs/auto_examples/images/thumb/sphx_glr_plot_stochastic_bornferg_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.3 KB
(97%)
docs/auto_examples/images/thumb/sphx_glr_plot_triangle_from_pandas_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"\n# ODP Bootstrap Comparison\n\n\nThis example demonstrates how you can drop the outlier link ratios from the\nBootstrapODPSample to reduce reserve variability estimates.\n\n\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import chainladder as cl\n\nimport seaborn as sns\nsns.set_style('whitegrid')\n\n# Load triangle\ntriangle = cl.load_dataset('raa')\n\n# Use bootstrap sampler to get resampled triangles\ns1 = cl.BootstrapODPSample(\n n_sims=5000, random_state=42).fit(triangle).resampled_triangles_\n\n## Alternatively use fit_transform() to access resampled triangles dropping\n# outlier link-ratios from resampler\ns2 = cl.BootstrapODPSample(\n drop_high=True, drop_low=True,\n n_sims=5000, random_state=42).fit_transform(triangle)\n\n# Summarize results of first model\nresults = cl.Chainladder().fit(s1).ibnr_.sum('origin').rename('columns', ['Original'])\n# Add another column to triangle with second set of results.\nresults['Dropped'] = cl.Chainladder().fit(s2).ibnr_.sum('origin')\n\n# Plot both IBNR distributions\nresults.to_frame().plot(kind='hist', bins=50, alpha=0.5)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
======================== | ||
ODP Bootstrap Comparison | ||
======================== | ||
This example demonstrates how you can drop the outlier link ratios from the | ||
BootstrapODPSample to reduce reserve variability estimates. | ||
""" | ||
import chainladder as cl | ||
|
||
import seaborn as sns | ||
sns.set_style('whitegrid') | ||
|
||
# Load triangle | ||
triangle = cl.load_dataset('raa') | ||
|
||
# Use bootstrap sampler to get resampled triangles | ||
s1 = cl.BootstrapODPSample( | ||
n_sims=5000, random_state=42).fit(triangle).resampled_triangles_ | ||
|
||
## Alternatively use fit_transform() to access resampled triangles dropping | ||
# outlier link-ratios from resampler | ||
s2 = cl.BootstrapODPSample( | ||
drop_high=True, drop_low=True, | ||
n_sims=5000, random_state=42).fit_transform(triangle) | ||
|
||
# Summarize results of first model | ||
results = cl.Chainladder().fit(s1).ibnr_.sum('origin').rename('columns', ['Original']) | ||
# Add another column to triangle with second set of results. | ||
results['Dropped'] = cl.Chainladder().fit(s2).ibnr_.sum('origin') | ||
|
||
# Plot both IBNR distributions | ||
results.to_frame().plot(kind='hist', bins=50, alpha=0.5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
af4123840aa71f01d2fd75aee3df3e94 |
Oops, something went wrong.