## pricing.price_over_payout()


A one-period price restated over a payout.


Usage


``` python
pricing.price_over_payout(
    price, pattern, *, rate=0.0, cost_of_capital=None, distortion=None
)
```


With a cost of capital [r](distributions.NegativeBinomial.md#prospicio.distributions.NegativeBinomial.r), the premium solves `P = E[X] d + r (a - P) A`: the loss discounted by the pattern's [discount_factor](pricing.PayoutPrice.md#prospicio.pricing.PayoutPrice.discount_factor) `d`, plus the cost of the initial capital held while losses are outstanding over `A = capital_years`. With a pricing distortion, the premium is discounted with the losses. Give the same rule the price was made with. A pattern that pays everything within the first year, at a zero rate, gives back the one-period price.


## Parameters


`price: Price`  
The one-period price, from [price](pricing.price.md#prospicio.pricing.price).

`pattern: PaymentPattern`  

`rate: float = ``0.0`  
Annual effective discount rate.

`cost_of_capital: float = None`  

`distortion: Distortion = None`  


## Returns


`PayoutPrice`  


## Examples

``` python
>>> from prospicio.distributions import Sampled
>>> from prospicio.pricing import PaymentPattern, price, price_over_payout
>>> from prospicio.risk import Distortion
>>> p = price(Sampled([0.0, 0.0, 2.0, 6.0]), Distortion.tvar(0.5), cost_of_capital=0.25)
>>> slow = PaymentPattern([1.0, 2.0, 3.0], [0.2, 0.3, 0.5])
>>> q = price_over_payout(p, slow, rate=0.0, cost_of_capital=0.25)
>>> round(q.capital_years, 12), round(q.premium, 6)
```

(2.3, 2.730159)
