## pricing.RetroPlan


A retrospective rating plan: the premium `T (b + c L)` for losses


Usage

``` python
pricing.RetroPlan()
```


`L`, no less than a minimum and no more than a maximum.

Amounts are in money. A plan with a loss limit takes `L` as the losses with each occurrence limited, and is balanced against a Table L.


## Parameters


`expected_loss: float`  
The expected losses `E`, without any loss limit.

`expense: float`  
Expenses and profit `e`, excluding the premium tax.

`loss_conversion: float = ``1.0`  
The loss conversion factor `c`.

`tax_multiplier: float = ``1.0`  
The tax multiplier `T`.

`minimum: float = ``0.0`  
The minimum premium `H`.

`maximum: float = inf`  
The maximum premium [G](distributions.TemperedStable.md#prospicio.distributions.TemperedStable.G).


## Raises


`ValueError`  
Unless `E`, `c` and `T` are positive and finite, `e` is non-negative and `0 <= H < G`.


## Examples

``` python
>>> from prospicio.pricing import InsuranceCharge, RetroPlan
>>> losses = [0.0, 10.0, 30.0, 50.0, 70.0, 90.0, 120.0, 150.0, 200.0, 280.0]
>>> plan = RetroPlan(100.0, 30.0, loss_conversion=1.1, tax_multiplier=1.03,
...                  minimum=80.0, maximum=220.0)
>>> balanced = plan.balance(InsuranceCharge.from_sample(losses))
>>> terms = plan.loss_sensitive_premium(balanced["basic"])
>>> mean = sum(terms.premium(losses)) / 10
>>> round(mean, 9) == round(plan.guaranteed_cost(), 9)
```

True


## Methods

| Name | Description |
|----|----|
| [balance()](#balance) | The basic premium at which the plan collects the guaranteed-cost |
| [guaranteed_cost()](#guaranteed_cost) | The guaranteed-cost premium `T (e + E)`. |
| [loss_sensitive_premium()](#loss_sensitive_premium) | The plan's premium terms under a basic premium, as a |

------------------------------------------------------------------------


#### balance()


The basic premium at which the plan collects the guaranteed-cost


Usage

``` python
balance(charge)
```


premium on average.


##### Parameters


`charge: InsuranceCharge`  
The table of the plan's aggregate losses, on the plan's expected losses: a Table M, or with a loss limit a Table L.


##### Returns


`dict`  
[basic](reinsurance.LossSensitivePremium.md#prospicio.reinsurance.LossSensitivePremium.basic), `entry_ratio_minimum` and `entry_ratio_maximum` (where the minimum and the maximum bind; the first is negative when the minimum never binds), `net_insurance_charge` and [expected_premium](reinsurance.TowerGrids.md#prospicio.reinsurance.TowerGrids.expected_premium).


##### Raises


`ValueError`  
If the table's expected loss is not the plan's, or the minimum is at least the guaranteed-cost premium, or the maximum at most it, or the minimum is high enough that only a negative basic premium would balance the plan.


------------------------------------------------------------------------


#### guaranteed_cost()


The guaranteed-cost premium `T (e + E)`.


Usage

``` python
guaranteed_cost()
```


##### Returns


`float`  


------------------------------------------------------------------------


#### loss_sensitive_premium()


The plan's premium terms under a basic premium, as a


Usage

``` python
loss_sensitive_premium(basic)
```


[prospicio.reinsurance.LossSensitivePremium](reinsurance.LossSensitivePremium.md#prospicio.reinsurance.LossSensitivePremium): `T (b + c L)` for a year's losses `L`, between the minimum and the maximum, with the tax multiplier folded into its basic premium and its loss conversion factor.


##### Parameters


`basic: float`  
The basic premium [b](pricing.Mbbefd.md#prospicio.pricing.Mbbefd.b), before the tax multiplier.


##### Returns


`prospicio.reinsurance.LossSensitivePremium`  
Its `premium(losses)` is the retrospective premium of each of a list of losses.


##### Raises


`ValueError`  
If [basic](reinsurance.LossSensitivePremium.md#prospicio.reinsurance.LossSensitivePremium.basic) is negative or not finite.


##### Examples

``` python
>>> from prospicio.pricing import RetroPlan
>>> plan = RetroPlan(100.0, 30.0, 1.1, 1.03, minimum=80.0, maximum=220.0)
>>> terms = plan.loss_sensitive_premium(25.0)
>>> terms.premium([0.0, 400.0])
```

\[80.0, 220.0\]
