> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Relativities

> Build and test insurance raters, explore pricing scenarios, and analyze rate changes with Python and pandas.

Relativities is Effective's Python package for insurance pricing.

Build and test your own raters, explore what-if scenarios, and measure rate changes by segment.
Run your programs and market programs against the same risks to investigate pricing differences.

Rating runs on your machine. Your submission data and results stay local.

[Install Relativities and set your API key](/relativities/setup) to get started.

```python theme={null}
from relativities import Program

program = Program.load("effective://example-ca-ppa")
book = program.example_book
results = program.rate(book)

results[["submission_id", "status", "premium"]].head(3)
#   submission_id     status premium
# 0       S000001  succeeded    2636
# 1       S000002  succeeded    5339
# 2       S000003  succeeded    2341
```

This synthetic California personal auto program includes an example book of 100,000 policies. Its `premium` outcome is the annual premium.

Each submission keeps its result row, status, and reason. Your policy data and rating results stay local.

## Core tasks

| Task | What you get |
| - | - |
| [Create a book](/relativities/how-to/create-a-book) | Your policies, checked against the line’s schema |
| [Download a program](/relativities/how-to/download-a-program) | A pinned program in a local folder |
| [Load a program](/relativities/how-to/load-a-program) | A program with its schema, inputs, and tables |
| [Rate a book with a program](/relativities/how-to/rate-a-book-with-a-program) | One row per submission, with its status and reason |
| [Create a market](/relativities/how-to/create-a-market) | Named programs to compare |
| [Rate a book against a market](/relativities/how-to/create-a-market) | Results for each submission and program |
| [Create a study](/relativities/how-to/create-a-study) | Scenarios and sampled versions of your book |
| [Rate a study with a program](/relativities/how-to/create-a-study) | Results for each submission, scenario, and draw |
| [Rate a study against a market](/relativities/how-to/create-a-study) | Study results across programs |

## How it works

A **book** holds your policy facts in pandas tables. A **program** prepares those facts for its rating algorithm and calculates the results.

A **market** compares several programs. A **study** creates scenarios and sampled draws from a book to test changes and assumptions.

Rating a book or study returns a DataFrame. Use pandas to analyze the results, and `explain` to inspect the calculations behind a premium.

## Build your own rating program

Use [RSL](/relativities/rsl/overview) to write rating calculations, input constraints, tables, rounding, and source citations.

[Package a program](/relativities/how-to/package-a-program) to bundle the rater with its input preparation function, schema, and examples.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.