reserving.DiscountCurve
Annual effective spot rates by maturity in years, annually compounded:
Usage
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 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
>>> from prospicio.reserving import DiscountCurve
>>> curve = DiscountCurve([1.0, 5.0], [0.02, 0.04])
>>> curve.rate(3.0)0.03
>>> round(curve.factor(2.0), 6)0.951814
>>> DiscountCurve.flat(0.03)DiscountCurve(maturities=[1.0], rates=[0.03])
Attributes
| Name | Description |
|---|---|
| maturities |
The maturities in years ([1.0] for a flat curve).
|
| 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() |
The discount factor of a payment at t years, (1 + r(t)) ** -t.
|
| flat() | One annual effective rate at every maturity. |
| rate() | The spot rate at t years. |
factor()
The discount factor of a payment at t years, (1 + r(t)) ** -t.
Usage
factor(t)Parameters
t: float
Returns
float
flat()
One annual effective rate at every maturity.
Usage
flat(rate)Parameters
rate: float- Finite and above -1.
Returns
DiscountCurve
rate()
The spot rate at t years.
Usage
rate(t)Parameters
t: float
Returns
float