## pricing.PaymentPattern


The share of the ultimate loss paid at each time, in years from the


Usage

``` python
pricing.PaymentPattern()
```


treaty's inception.

With a pattern that does not depend on the size of the loss, every simulated year's present value is its loss times [discount_factor](pricing.PayoutPrice.md#prospicio.pricing.PayoutPrice.discount_factor), so a loss distribution is discounted by scaling it.


## Parameters


`times: list of float`  
Non-negative, strictly increasing times, in years from inception.

`shares: list of float`  
The share paid at each time; they sum to 1.


## Examples

``` python
>>> from prospicio.pricing import PaymentPattern
>>> p = PaymentPattern.from_development([1.0, 2.0, 3.0], [4.0, 1.25, 1.0])
>>> [round(s, 12) for s in p.shares]
```

\[0.25, 0.55, 0.2\]

``` python
>>> round(p.duration, 12), round(p.discount_factor(0.05), 6)
```

(1.95, 0.909729)


## Attributes

| Name | Description |
|----|----|
| [duration](#duration) | The mean time to payment, undiscounted. |
| [shares](#shares) | The share paid at each time. |
| [times](#times) | The times. |

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


#### duration


The mean time to payment, undiscounted.


`duration: float`


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


#### shares


The share paid at each time.


`shares: list[float]`


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


#### times


The times.


`times: list[float]`


## Methods

| Name | Description |
|----|----|
| [capital_years()](#capital_years) | The discounted capital years per unit of initial capital: capital |
| [discount_factor()](#discount_factor) | The present value at inception of a unit of ultimate loss, at an |
| [from_development()](#from_development) | From development factors to ultimate by age, such as a paid chain |
| [outstanding()](#outstanding) | The share not yet paid at time [t](distributions.Pareto.md#prospicio.distributions.Pareto.t). |
| [paid_by()](#paid_by) | The share paid by time [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) in years, read between the pattern's |
| [shifted()](#shifted) | The pattern `by` years later. |
| [to_monthly()](#to_monthly) | The cumulative share paid at the end of each of `months` months, |
| [unpaid_from()](#unpaid_from) | The pattern of what is unpaid at `age`, with times measured from |

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


#### capital_years()


The discounted capital years per unit of initial capital: capital


Usage

``` python
capital_years(rate)
```


held in each year in proportion to the share outstanding at its start, charged at the start of the year.


##### Parameters


`rate: float`  


##### Returns


`float`  


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


#### discount_factor()


The present value at inception of a unit of ultimate loss, at an


Usage

``` python
discount_factor(rate)
```


annual effective [rate](pricing.CasualtyProfile.md#prospicio.pricing.CasualtyProfile.rate).


##### Parameters


`rate: float`  


##### Returns


`float`  


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


#### from_development()


From development factors to ultimate by age, such as a paid chain


Usage

``` python
from_development(ages, factors)
```


ladder's [cdf](risk.Gpd.md#prospicio.risk.Gpd.cdf): the share paid by each age is one over its factor.

The last factor must be 1 (add any tail as a last age). Ages are read as times from inception; [shifted](pricing.PaymentPattern.md#prospicio.pricing.PaymentPattern.shifted) moves the pattern when losses start developing later.


##### Parameters


`ages: list of float`  

`factors: list of float`  


##### Returns


`PaymentPattern`  


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


#### outstanding()


The share not yet paid at time [t](distributions.Pareto.md#prospicio.distributions.Pareto.t).


Usage

``` python
outstanding(t)
```


##### Parameters


`t: float`  


##### Returns


`float`  


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


#### paid_by()


The share paid by time [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) in years, read between the pattern's


Usage

``` python
paid_by(t, interpolation="step")
```


times by [interpolation](pricing.TabulatedCurve.md#prospicio.pricing.TabulatedCurve.interpolation): `"step"` (each share paid at its time), `"linear"` (evenly over the period ending at it) or `"log_linear_unpaid"` (the unpaid share falling geometrically).


##### Examples

``` python
>>> from prospicio.pricing import PaymentPattern
>>> p = PaymentPattern([1.0, 2.0], [0.6, 0.4])
>>> p.paid_by(0.5), round(p.paid_by(0.5, "linear"), 12)
```

(0.0, 0.3)

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


#### shifted()


The pattern `by` years later.


Usage

``` python
shifted(by)
```


##### Parameters


`by: float`  


##### Returns


`PaymentPattern`  


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


#### to_monthly()


The cumulative share paid at the end of each of `months` months,


Usage

``` python
to_monthly(months, interpolation="linear")
```


`paid_by((m + 1) / 12)`: at month `12 k - 1` the pattern's share at [k](models.TargetEncoding.md#prospicio.models.TargetEncoding.k) years. The monthly paid pattern of `CashflowTerms`.


##### Examples

``` python
>>> from prospicio.pricing import PaymentPattern
>>> p = PaymentPattern.from_development([1.0, 2.0, 3.0], [4.0, 1.25, 1.0])
>>> m = p.to_monthly(36)
>>> round(m[11], 12), round(m[23], 12), m[35]
```

(0.25, 0.8, 1.0)

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


#### unpaid_from()


The pattern of what is unpaid at `age`, with times measured from


Usage

``` python
unpaid_from(age)
```


`age`: the payments after it, each over the share outstanding. For a reserve valued at `age`, such as one ceded under a loss portfolio transfer; payments at `age` itself count as paid.


##### Parameters


`age: float`  


##### Returns


`PaymentPattern`  


##### Examples

``` python
>>> from prospicio.pricing import PaymentPattern
>>> p = PaymentPattern([1.0, 2.0, 3.0, 4.0], [0.25] * 4).unpaid_from(2.0)
>>> p.times, p.shares
```

(\[1.0, 2.0\], \[0.5, 0.5\])
