## reserving.DiscountCurve


Annual effective spot rates by maturity in years, annually compounded:


Usage

``` python
reserving.DiscountCurve()
```


linear in the rate between maturities and flat before the first and after the last. The discount factor of a payment at [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) years is `(1 + r(t)) ** -t`.


## Parameters


`maturities: list of float`  
Maturities in years: finite, positive and strictly increasing.

`rates: list of float`  
The spot rate at each maturity: finite and above -1.


## Examples

``` python
>>> from prospicio.reserving import DiscountCurve
>>> curve = DiscountCurve([1.0, 5.0], [0.02, 0.04])
>>> curve.rate(3.0)
```

0.03

``` python
>>> round(curve.factor(2.0), 6)
```

0.951814

``` python
>>> DiscountCurve.flat(0.03)
```

DiscountCurve(maturities=\[1.0\], rates=\[0.03\])


## Attributes

| Name | Description |
|----|----|
| [maturities](#maturities) | The maturities in years (`[1.0]` for a flat curve). |
| [rates](#rates) | The spot rate at each maturity. |

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


#### maturities


The maturities in years (`[1.0]` for a flat curve).


`maturities: list[float]`


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


#### rates


The spot rate at each maturity.


`rates: list[float]`


## Methods

| Name | Description |
|----|----|
| [factor()](#factor) | The discount factor of a payment at [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) years, `(1 + r(t)) ** -t`. |
| [flat()](#flat) | One annual effective rate at every maturity. |
| [rate()](#rate) | The spot rate at [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) years. |

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


#### factor()


The discount factor of a payment at [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) years, `(1 + r(t)) ** -t`.


Usage

``` python
factor(t)
```


##### Parameters


`t: float`  


##### Returns


`float`  


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


#### flat()


One annual effective rate at every maturity.


Usage

``` python
flat(rate)
```


##### Parameters


`rate: float`  
Finite and above -1.


##### Returns


`DiscountCurve`  


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


#### rate()


The spot rate at [t](distributions.Pareto.md#prospicio.distributions.Pareto.t) years.


Usage

``` python
rate(t)
```


##### Parameters


`t: float`  


##### Returns


`float`
