Skip to main content
Generated from the package’s Python API. Experience and the overall rate indication, in exact arithmetic. Triangle develops losses to ultimate: factors averages its link ratios into a table to edit in pandas, and develop projects each origin with it. Trend fits or holds an annual trend and gives the factor between two points in time. RateHistory gives parallelogram on-level factors for calendar-year premium. Indication turns a projected loss ratio and expense provisions into the indicated overall change; with_credibility blends it with a complement, weighted by credibility, and explain shows each step. Every amount is a Decimal and every factor is exact to 38 significant digits; floats are refused where they would carry binary rounding into a rate. Rating relativities by class come from relativities.models.FactorModel. Develop losses Trend and on-level Indicate a change

Triangle

Cumulative losses (or counts) by origin period and development age. Build one from a long table with one row per origin and age; origin is the accident, policy or report period and age its development age as a positive integer, such as months. Values are exact Decimals. Each origin’s ages are the first ages of the triangle in sequence, so each link ratio compares the same origin one age apart. factors averages the link ratios into one selected factor per age and develop projects each origin to ultimate with a factors table. Edit the factor column of factors() in pandas to make your own selections, then pass it to develop.

Triangle.origins

The origin periods, in order.

Triangle.ages

The development ages, in order.

Triangle.to_pandas

The cumulative triangle: one row per origin and one column per age. NaN marks each age beyond an origin’s latest.
Each origin’s age-to-age ratios: one column per age, the ratio from that age to the next. NaN marks a ratio beyond an origin’s latest age, or from a zero value.

Triangle.factors

One selected factor per age, and the cumulative factor to ultimate. average is volume (the sum of later values over the sum of earlier values) or simple (the mean of the link ratios). periods keeps only the latest origins that reach each pair of ages, such as the latest three. tail is the factor from the last age to ultimate. The last row is the tail. Columns: age, factor (from this age to the next, or to ultimate on the last row), cdf (from this age to ultimate) and origins (how many origins the average used). Edit factor to select your own; develop reads only age and factor and recalculates cdf.

Triangle.develop

Each origin projected to ultimate with a factors table (factors() by default). Each factor develops from its age to the next age in the table, and the last row develops to ultimate. An age’s cumulative factor is the product of the factors at that age and every later age in the table, so a table selected on a longer triangle keeps its later factors and tail. The table needs one row for each age of this triangle; ages are unique. Columns: origin, age (its latest age), latest (its latest value), cdf, ultimate (latest times cdf) and unreported (ultimate less latest: IBNR for reported losses, unpaid for paid losses).

Trend

An annual exponential trend, such as 4% a year in claim severity. Trend(Decimal("0.04")) is a selected trend; Trend.fit fits one to a series by least squares on the logarithm of its values. factor(start, end) is (1 + rate) ** years between two points in time, each a date or a number of years, such as the average accident date of an experience period and of the future policy period.

Trend.fit

Fit value = a * (1 + rate) ** period by least squares on log(value). period holds dates or numbers of years, such as each quarter’s midpoint, and value positive amounts, such as average severity or frequency. observations on the result holds each point with its fitted value.

Trend.rate

The annual rate: 0.04 is 4% a year.

Trend.observations

The fitted series and each point’s fitted value, or None for a selected trend.

Trend.factor

(1 + rate) ** years from start to end, each a date or a number of years.

RateHistory

Overall rate changes by effective date, such as {date(2023, 7, 1): Decimal("0.05")}. The rate level is 1 before the first change and is multiplied by 1 + change at each effective date. on_level finds the factors that bring each calendar year’s premium to the current level by the parallelogram method: policies are written evenly through the year, each change applies to policies written on or after its date, and premium is earned evenly over the term. When you have the policies, rating them again at current rates with Program.rate is the exact alternative.

RateHistory.levels

Each change with the cumulative rate level from its effective date.

RateHistory.on_level

On-level factors for calendar years. basis is earned (calendar-year earned premium) or written (calendar-year written premium). term_months is the policy term. Columns: year, average_level (the year’s average rate level), current_level and factor (current_level over average_level, which multiplies the year’s premium).

Indication

The overall rate change the loss ratio method indicates. loss_ratio is the projected ultimate loss and LAE ratio: developed, trended losses over premium at current rate level. fixed_expense is the fixed expense ratio at current rates, variable_expense the variable expense ratio and profit the profit and contingencies provision, each a share of premium. The indicated change is (loss_ratio + fixed_expense) / (1 - variable_expense - profit) - 1. with_credibility blends it with a complement, and explain shows each step.

Indication.permissible_loss_ratio

The share of premium left for losses, LAE and fixed expenses: 1 - variable_expense - profit.

Indication.indicated

The indicated change from this experience alone, before credibility.

Indication.change

The indicated change after credibility: 0.05 is a 5% increase.

Indication.with_credibility

A copy whose change is credibility * indicated + (1 - credibility) * complement. credibility is between 0 and 1, such as credibility(claims). complement is the change that takes the remaining weight, such as the trended change since the last review or a larger book’s indication.

Indication.explain

Each step of the indication: its name, value and formula.

credibility

Limited fluctuation credibility: min(1, sqrt(claims / standard)). standard is the claim count for full credibility, 1,082 by default; full_credibility computes it for other probability and tolerance choices.

full_credibility

The expected claims for full credibility under limited fluctuation: (z / tolerance) ** 2, where z is the standard normal quantile of (1 + probability) / 2. The defaults give about 1,082 claims. The quantile is solved in Decimal to the module’s 38 digits.