Skip to main content
This example increases collision base rates by 5% and tests a scenario with 10% higher annual mileage.

Load the current program

The example program and book are synthetic. Premiums are for annual policies.

Create the proposed program

Define the helper below once, then choose the percentage increase.
This helper uses ordinary Python and pandas to edit a rating table. It is defined on this page, rather than built into Relativities.
The helper returns a new program. The current program stays unchanged.
Create a proposed program with a 5% collision base-rate increase, then put both programs in a market:
The market compares rates. Next, the study creates versions of the book to test an assumption.

Add a mileage scenario

Define the scenario helper below once, then choose the mileage increase.
The function uses ordinary Python and pandas to change vehicle mileage. Relativities’ @scenario decorator gives the change a name and parameters.
Reported missing mileage stays missing. The original book stays unchanged.
Create a study containing the reported book and the higher-mileage scenario:
baseline uses the reported facts. Mileage +10% increases each vehicle’s annual mileage by 10%.

Rate the study

Rate both versions of the book with both programs:
Each result identifies its submission, program, and scenario. premium is the annual policy premium for this example.

Compare the rate change

This helper uses pandas to compare total premiums. It keeps submissions that all programs and scenarios rate successfully.
Both scenario comparisons use the same submissions.
Show the proposed rate change under each mileage assumption:
These results use the full 100,000-policy example book. Both comparisons include the same 96,671 submissions. The rate increase raises total annual premium by 1.81% under both mileage assumptions, rounded to two decimal places. Compare baseline with Mileage +10% to assess how the mileage assumption changes the measured rate impact.

Check rating exceptions

Count statuses by program and scenario:
Keep these counts and the unrated submissions’ reasons alongside the premium comparison. Higher mileage can change whether a submission rates successfully.

Next steps

Change percent=5 to test another collision rate increase. Change percent=10 to test another mileage assumption. Books and studies explains scenarios and sampled draws.