Skip to main content
This guide models workers’ compensation rated on payroll by state and class. Its three policies, schema and tariff are synthetic. A property book follows the same steps with a location and building schema.

Define the schema and book

Each policy reports payroll by state and class code. The classes key includes the state, so policy W1 reports class 8810 in two states:
references makes each class row name a state row of its own submission. Policy W3 leaves its payroll blank. Create a book describes the schema rules.

Save the toy tariff

The tariff charges a rate per $100 of payroll for each class code. Save the rater and its rate table:
wc/rater.rsl
wc/tables/ClassRate.csv
The toy rates apply in every state. Real programs add state rates, experience modification and premium discounts.

Rate two versions

Build the rater, then derive an alternative with new class rates:
prepare passes each policy’s class rows as the rater’s classes list. The current rates charge W1 and W2 $3,000 each. The alternative charges W1 $2,400 and W2 $3,300. Both versions return W3 as invalid_inputs, because its payroll is blank.

Compare premium per payroll

Total each policy’s payroll onto its submission, and name it as the exposure base:
Both versions share one coverage basis, so terms returns the same PremiumTerms for every quote. The alternative lowers premium by 5% on the two rated policies. It charges $1.43 per $100 of their payroll, against $1.50 under the current rates. W3 stays in the population as unrated.

Calibrate the portfolio mix

Reweight the policies to match target policy counts by industry:
In this construction-heavy mix, the decrease narrows to 2%. calibration.targets reports each target’s source count, achieved count and residual. One attribute is post-stratified exactly; several attributes are raked. The calibrated analysis reuses every quote. These targets are illustrative; base real targets on market or exposure evidence.

Find a matching rate

search_lever searches one rating parameter until a program meets a premium target. Here it finds the class 5403 rate that matches the alternative’s premium:
With class 8810 at 1.00, a 5403 rate of 2.70 matches the alternative’s $5,700 on the two rated policies. Each step builds one rater and rates the whole book. Pair a suggested rate with the program’s indicated rate need before you act on it.

Next step

Analyze supplied quotes to count rated policies, show the distribution of changes and rank several programs.