PremiumAnalysis. Each method returns typed rows; to_pandas() produces a detached table for charts.
Supply the records
These quotes are synthetic annual premiums. Policy B represents two policies, and policy C has a population row only:RatingSource("rater_bundle", bundle_id) for compiled rater outputs.
Reuse a book or native rating results
PremiumAnalysis.from_book(book, quotes, ...) pairs supplied quotes with every submission of a Book or Study. PremiumAnalysis.from_market(results, book, ...) converts policy-level Market.rate rows.
Both map submission columns through segments, weight, profile, exposure, losses and claim_count, and keep unquoted submissions in the population. The from_market callback terms returns each successful row’s PremiumTerms.
Model a commercial book uses from_market with a payroll exposure base and a calibrated mix.
Inspect policy comparisons
pair_results() returns each policy’s two quotes, and check_comparability() lists each term difference.
Summarize the population
summarize(by=("size",)) returns one summary per segment, and each scenario and draw keeps its own summary.
Apply another mix
Supply one Decimal count weight per policy context:analysis.calibrate(targets) derives the weights from target counts by segment. Changed rating inputs require updated quotes.
Inspect a term mismatch
Give the alternative a higher deductible:basis_mismatch, and its premium change is None.
Count what was rated
Show the distribution of changes
Compare premium with losses
double_lift sorts paired policies by price ratio, candidate over baseline premium, and compares each group’s actual losses with both programs’ premium. Supply losses as PolicyExposure.losses, or with from_book(losses=...):
edges for equal-weight groups, and add claim_count for each group’s credibility.
Spread across simulated draws
When aStudy fills unknown risk facts, each draw rates its own version of the book. draw_ranges summarizes every draw, then reports quantiles across draws:
include_draw_zero=True to include it. These quantiles describe the spread of draws, rather than confidence intervals.
Model an unknown that applies to a whole program, such as a redacted factor, as separate low, middle and high scenarios. Drawing it policy by policy averages it away.
Rank several programs
ranking.to_pandas() shows each policy’s rank and its gap to the cheapest program.
The analysis reference lists the typed records, methods, and dataframe functions.