Obligationsvärdering och -analys i Python
Joshua Mayhew
Options Trader
$FV = PV \times (1 + r)^n$
$PV = \frac{FV}{(1 + r)^n}$

En högre ränta eller längre tidsperiod ökar FV
Därför måste en högre ränta eller längre tidsperiod minska PV
import numpy_financial as npf
?npf.pv
Signature: npf.pv(rate, nper, pmt, fv=0) Docstring: Compute the present value.Given: * a future value, `fv`* an interest `rate` compounded once per period, of which there are* `nper` total* a (fixed) payment, `pmt`Return: the value now
import numpy_financial as npf
npf.pv(rate=0.05, nper=10, pmt=0, fv=10000)
-6139.13
-npf.pv(rate=0.05, nper=10, pmt=0, fv=10000)
6139.13
pv = 10000 / (1 + 0.05) ** 10
print(pv)
6139.13
Vi tittar på ett exempel med en nollkupongsobligation som:
Vad är priset på denna obligation?
import numpy_financial as npf
-npf.pv(rate=0.035, nper=3, pmt=0, fv=100)
90.19
pv = 100 / (1 + 0.035) ** 3
print(pv)
90.19
Obligationsvärdering och -analys i Python