diff --git a/chainladder/development/constant.py b/chainladder/development/constant.py index 458bd817..4a4c7b60 100644 --- a/chainladder/development/constant.py +++ b/chainladder/development/constant.py @@ -114,12 +114,14 @@ def __init__(self, patterns=None, style="ldf", callable_axis=0, groupby=None): def fit(self, X, y=None, sample_weight=None): """Fit the model with X. + Parameters ---------- X : Triangle-like     Set of LDFs to which the munich adjustment will be applied. y : Ignored sample_weight : Ignored + Returns ------- self : object diff --git a/chainladder/development/glm.py b/chainladder/development/glm.py index 7cff4b69..eb488d11 100644 --- a/chainladder/development/glm.py +++ b/chainladder/development/glm.py @@ -41,22 +41,26 @@ class TweedieGLM(DevelopmentBase): Column name for the response variable of the GLM. If omitted, then the first column of the Triangle will be used. power: float, default=1 - The power determines the underlying target distribution according - to the following table: - +-------+------------------------+ - | Power | Distribution | - +=======+========================+ - | 0 | Normal | - +-------+------------------------+ - | 1 | Poisson | - +-------+------------------------+ - | (1,2) | Compound Poisson Gamma | - +-------+------------------------+ - | 2 | Gamma | - +-------+------------------------+ - | 3 | Inverse Gaussian | - +-------+------------------------+ - For ``0 < power < 1``, no distribution exists. + The power determines the underlying target distribution according + to the following table: + + .. list-table:: + :header-rows: 1 + + * - Power + - Distribution + * - 0 + - Normal + * - 1 + - Poisson + * - (1,2) + - Compound Poisson Gamma + * - 2 + - Gamma + * - 3 + - Inverse Gaussian + + For ``0 < power < 1``, no distribution exists. alpha: float, default=1 Constant that multiplies the penalty term and thus determines the regularization strength. ``alpha = 0`` is equivalent to unpenalized diff --git a/chainladder/utils/utility_functions.py b/chainladder/utils/utility_functions.py index 84f70d45..cc967bf4 100644 --- a/chainladder/utils/utility_functions.py +++ b/chainladder/utils/utility_functions.py @@ -990,7 +990,8 @@ def model_diagnostics( - ``Run Off 1/2/3...``: Expected incremental emergence in successive future valuation periods (from ``full_expectation_``) - ``Apriori``: Expected ultimate for Benktander family of methods (from ``expectation_``) - Columns from the original Triangle are cross-joined into the index. ``Measure`` will contain all the columns from the original Triangle. + Columns from the original Triangle are cross-joined into the index. + ``Measure`` will contain all the columns from the original Triangle. """ from chainladder import Pipeline, Triangle diff --git a/docs/user_guide/utilities.ipynb b/docs/user_guide/utilities.ipynb index 6aa89f34..deb85ee6 100644 --- a/docs/user_guide/utilities.ipynb +++ b/docs/user_guide/utilities.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "7e2c2fa7-9d32-404b-9121-51d06ac57324", "metadata": {}, "source": [ "# Utilities\n", @@ -13,38 +12,54 @@ "\n", "## Sample Datasets\n", "\n", - "A variety of datasets can be loaded using :func:`load_sample()`. These are\n", - "sample datasets that are used in a variety of examples within this\n", - "documentation.\n", - "\n", - "\n", - "| Dataset | Description | \n", - "|-----------|------------------------------------------------------|\n", - "| abc | ABC Data |\n", - "| auto | Auto Data |\n", - "| berqsherm | Data from the Berquist Sherman paper |\n", - "| cc_sample | Sample Insurance Data for Cape Cod Method in Struhuss|\n", - "| clrd | CAS Loss Reserving Database |\n", - "| genins | General Insurance Data used in Clark |\n", - "| ia_sample | Sample data for Incremental Additive Method in Schmidt|\n", - "| liab | more data|\n", - "| m3ir5 | more data|\n", - "| mcl | Sample insurance data for Munich Adjustment in Quarg|\n", - "| mortgage | more data|\n", - "| mw2008 | more data|\n", - "| mw2014 | more data|\n", - "| quarterly | Sample data to demonstrate changing Triangle grain|\n", - "| raa | Sample data used in Mack Chainladder|\n", - "| ukmotor | more data|\n", - "| usaa | more data|\n", - "| usauto | more data|\n", + "A variety of datasets can be loaded using `load_sample()`. These are sample\n", + "datasets that are used throughout the examples in this documentation. The full\n", + "list is available through `list_samples()`, which returns a table of every\n", + "bundled dataset along with its index, columns, and grain." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import chainladder as cl\n", "\n", + "cl.list_samples()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Model Diagnostics\n", "\n", + "`model_diagnostics()` summarizes a fitted IBNR model into a single Triangle\n", + "whose columns are the diagnostic vectors of interest, such as the latest\n", + "diagonal, IBNR, and ultimate. It accepts a fitted estimator or a `Pipeline`,\n", + "and an optional `groupby` to summarize at a coarser index level." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "model = cl.Chainladder().fit(cl.load_sample('raa'))\n", + "cl.model_diagnostics(model)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "## Chainladder Persistence\n", "\n", - "All estimators can be persisted to disk or database\n", - "using ``to_json`` or ``to_pickle``. Restoring the estimator is as simple as\n", - "``cl.read_json`` or ``cl.read_pickle``.\n" + "All estimators can be persisted to disk or database using `to_json` or\n", + "`to_pickle`. Restoring the estimator is as simple as `cl.read_json` or\n", + "`cl.read_pickle`." ] }, {