|
1 | | -""" |
2 | | - Copyright (C) 2015, Enthought Inc |
3 | | - Copyright (C) 2015, Patrick Henaff |
| 1 | +# |
| 2 | +# Copyright (C) 2015, Enthought Inc |
| 3 | +# Copyright (C) 2015, Patrick Henaff |
| 4 | +# |
| 5 | +# This program is distributed in the hope that it will be useful, but WITHOUT |
| 6 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 7 | +# FOR A PARTICULAR PURPOSE. See the license for more details. |
4 | 8 |
|
5 | | - This program is distributed in the hope that it will be useful, but WITHOUT |
6 | | - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
7 | | - FOR A PARTICULAR PURPOSE. See the license for more details. |
8 | | -""" |
9 | | - |
10 | | -include '../../types.pxi' |
| 9 | +from quantlib.types cimport Rate, Real, Time |
11 | 10 |
|
12 | 11 | from quantlib.handle cimport static_pointer_cast |
13 | | -from quantlib.models.model cimport CalibratedModel |
14 | | -cimport quantlib.models._model as _model |
| 12 | +from quantlib.instruments.option cimport OptionType |
15 | 13 | cimport quantlib.models.shortrate._onefactor_model as _ofm |
16 | 14 | cimport quantlib._stochastic_process as _sp |
17 | 15 | from quantlib.stochastic_process cimport StochasticProcess1D |
@@ -43,6 +41,10 @@ cdef class OneFactorAffineModel(OneFactorModel): |
43 | 41 | def __init__(self): |
44 | 42 | raise ValueError('Cannot instantiate OneFactorAffineModel') |
45 | 43 |
|
46 | | - def discount_bound(self, Time now, Time maturity, Rate rate): |
| 44 | + def discount_bond(self, Time now, Time maturity, Rate rate): |
47 | 45 | return (<_ofm.OneFactorAffineModel*>self._thisptr.get()).discountBond( |
48 | 46 | now, maturity, rate) |
| 47 | + |
| 48 | + def discount_bond_option(self, OptionType option_type, Real strike, Time maturity, Time bond_maturity): |
| 49 | + return (<_ofm.OneFactorAffineModel*>self._thisptr.get()).discountBondOption( |
| 50 | + option_type, strike, maturity, bond_maturity) |
0 commit comments