## pricing.TabulatedCurve


A tabulated exposure curve: points `(x, G(x))` from `(0, 0)` to


Usage


``` python
pricing.TabulatedCurve()
```


`(1, 1)`, interpolated linearly, as published curves are given (Salzmann's homeowners scale, Ludwig's curves, ISO PSOLD tables, a reinsurer's own).

The table must be concave (its slopes never increase). Its destruction rate is discrete: the points' [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x) with probabilities from the drops in slope, and a total loss with probability last slope over first. Its mean rate is the first chord's, `x1 / G(x1)`, so a table needs fine first points for the expected loss to be right.


## Parameters


`x: list of float`  
Increasing from 0 to 1.

`g: list of float`  
`G(x)`, from 0 to 1.


## Raises


`ValueError`  
If the points do not run from `(0, 0)` to `(1, 1)`, or are not increasing and concave.


## Examples

``` python
>>> from prospicio.pricing import TabulatedCurve
>>> t = TabulatedCurve([0.0, 0.1, 0.5, 1.0], [0.0, 0.4, 0.8, 1.0])
>>> round(t.curve([0.3])[0], 12), t.mean_rate()
```

(0.6, 0.25)


## Attributes

| Name | Description |
|----|----|
| [g](#g) | The table's `G(x)`. |
| [x](#x) | The table's [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x). |

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


#### g


The table's `G(x)`.


`g: list[float]`


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


#### x


The table's [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x).


`x: list[float]`


## Methods

| Name | Description |
|----|----|
| [curve()](#curve) | The exposure curve `G(x)` at each [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x) (clamped to \[0, 1\]). |
| [layer_share()](#layer_share) | Share of a risk's expected loss in the layer [limit](reinsurance.Layer.md#prospicio.reinsurance.Layer.limit) xs |
| [mean_rate()](#mean_rate) | Mean destruction rate, `x1 / G(x1)`. |
| [rate_quantile()](#rate_quantile) | Destruction rate at each probability `u` in `(0, 1)`. |

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


#### curve()


The exposure curve `G(x)` at each [x](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.x) (clamped to \[0, 1\]).


Usage


``` python
curve(x)
```


##### Parameters


`x: list of float`  


##### Returns


`list of float`  


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


#### layer_share()


Share of a risk's expected loss in the layer [limit](reinsurance.Layer.md#prospicio.reinsurance.Layer.limit) xs


Usage


``` python
layer_share(limit, attachment, mpl)
```


[attachment](reinsurance.Layer.md#prospicio.reinsurance.Layer.attachment), for a risk with maximum possible loss `mpl`.


##### Parameters


`limit: float`  

`attachment: float`  

`mpl: float`  


##### Returns


`float`  


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


#### mean_rate()


Mean destruction rate, `x1 / G(x1)`.


Usage


``` python
mean_rate()
```


##### Returns


`float`  


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


#### rate_quantile()


Destruction rate at each probability `u` in `(0, 1)`.


Usage


``` python
rate_quantile(u)
```


##### Parameters


`u: list of float`  


##### Returns


`list of float`
