# Beyond loss

> The flows a contract generates besides loss, such as reinstatement premium, each kept as its own table keyed on the occurrence key.

Source: https://reinsurance.dev/financial-modelling/beyond-loss/

The [term catalog](https://reinsurance.dev/financial-modelling/terms/) transforms loss: every term reads a [year event loss table (YELT)](https://reinsurance.dev/glossary/#yelt-year-event-loss-table) and writes one. A contract also generates flows that are not loss. The cedent pays a premium, pays a reinstatement premium when a paid [reinstatement](https://reinsurance.dev/glossary/#reinstatement) restores the limit, and may receive part of the premium back through a no-claims bonus or a profit commission; brokerage and taxes are deducted from the premium. Some of these flows depend on the losses in the trial, and including them changes a contract's risk as well as its expected cost.

Each flow's amounts are computed from a contract's output and kept in a **separate table keyed on the occurrence key** `(trial_id, timestamp, event_id)`, not a column in the loss table: on this site the YELT's `loss` column holds positive losses only, under the [sign convention](https://reinsurance.dev/toolkit/trials/#sign-convention). A flow set for the whole year, such as a premium fixed at inception or a profit commission on the year's result, has a trial and a date but no event, so it is combined with the losses at the per-trial sum rather than in an occurrence join. A join on the key gives one column per flow; the loss table holds one row per occurrence, cedent, geography and line of business, so it is summed to the occurrence key before the join, or each occurrence's premium would be counted once per row. A concatenation stacks the tables into one long table of flows. Pricing and portfolio work need only per-trial sums, which either form provides.

:::note[In Practice]
Contract 1 has three occurrences in Trial 9 that reach the layer. Its loss table, summed to the occurrence key, and its [reinstatement premium](https://reinsurance.dev/financial-modelling/beyond-loss/reinstatement-premium/#contract-1-on-trial-9) table (\$M, at 100%) give two views. A join on the key has one row per occurrence and one column per flow:

| `trial_id` | `timestamp` | `event_id` | `loss` | `reinstatement_premium` |
| ---: | --- | ---: | ---: | ---: |
| 9 | 2024-07-12 | 10079 | 19.70 | 9.20 |
| 9 | 2024-09-06 | 10007 | 30.00 | 4.80 |
| 9 | 2024-10-05 | 10037 | 10.30 | 0.00 |

A concatenation has one row per occurrence and flow, and a `flow` column that names the table each row came from:

| `trial_id` | `timestamp` | `event_id` | `flow` | `amount` |
| ---: | --- | ---: | --- | ---: |
| 9 | 2024-07-12 | 10079 | `loss` | 19.70 |
| 9 | 2024-07-12 | 10079 | `reinstatement_premium` | 9.20 |
| 9 | 2024-09-06 | 10007 | `loss` | 30.00 |
| 9 | 2024-09-06 | 10007 | `reinstatement_premium` | 4.80 |
| 9 | 2024-10-05 | 10037 | `loss` | 10.30 |
| 9 | 2024-10-05 | 10037 | `reinstatement_premium` | 0.00 |

```python
KEY = ['trial_id', 'timestamp', 'event_id']
wide = loss.merge(rip, on=KEY, how='left').fillna({'reinstatement_premium': 0.0})
long = pd.concat([
    loss.rename(columns={'loss': 'amount'}).assign(flow='loss'),
    rip.rename(columns={'reinstatement_premium': 'amount'}).assign(flow='reinstatement_premium'),
])
```

Both give the reinsurer's outcome on Trial 9, \$60.00M of loss less \$14.00M of reinstatement premium, \$46.00M: the joined table as the difference of its two column sums, the concatenated table by summing `amount` per `flow` and taking the same difference. A new flow adds a column to the joined table and only rows to the concatenated one, whose columns stay fixed; a store that receives flows of many kinds keeps that shape. This site keeps each flow in its own table and forms either view when a calculation needs it.
:::

| Flow | Depends on the trial's losses | Entry |
| --- | --- | --- |
| [Reinstatement premium](https://reinsurance.dev/glossary/#reinstatement-premium) | Yes: charged for limit restored, pro rata to amount and optionally to time | [Reinstatement premium](https://reinsurance.dev/financial-modelling/beyond-loss/reinstatement-premium/) |
| Base premium | No, for a premium fixed at inception | Used as one amount per contract in [standalone pricing](https://reinsurance.dev/applications/standalone-pricing/#step-3-from-metrics-to-premium); a table of its own is *(planned)* |
| Commissions, [no-claims bonus](https://reinsurance.dev/glossary/#no-claims-bonus) | Sliding-scale and profit commissions: yes, they depend on the loss ratio. A flat ceding commission: no. The bonus: yes, it is paid only in a trial without claims | *(planned)* |
| Brokerage, taxes and levies | Through the premium they are charged on: no on a fixed premium, yes on reinstatement premium | *(planned)* |

Including a fixed flow, the same in every trial, changes every trial's outcome by the same amount, so it changes the expected result and leaves the required capital, [Tail Value at Risk (TVaR)](https://reinsurance.dev/glossary/#tvar-tail-value-at-risk) less expected loss, unchanged. The loss-dependent flows are the ones worth modelling trial by trial, and [reinstatement premium](https://reinsurance.dev/financial-modelling/beyond-loss/reinstatement-premium/) is the first.
