Ibor Lmm Products
financepy.products.rates.ibor_lmm_products
This module implements the LMM in the spot measure. It combines both model
and product specific code - I am not sure if it is better to separate these. At
the moment this seems to work ok.
THIS IS STILL IN PROTOPTYPE MODE. DO NOT USE.
Classes
IborLMMProducts
IborLMMProducts(settle_dt: financepy.utils.date.Date, maturity_dt: financepy.utils.date.Date, float_freq_type: financepy.utils.frequency.FrequencyTypes = <FrequencyTypes.QUARTERLY: 4>, float_dc_type: financepy.utils.day_count.DayCountTypes = <DayCountTypes.THIRTY_E_360: 2>, cal_type: financepy.utils.calendar.CalendarTypes = <CalendarTypes.WEEKEND: 2>, bd_type: financepy.utils.calendar.BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>, dg_type: financepy.utils.calendar.DateGenRuleTypes = <DateGenRuleTypes.BACKWARD: 2>)
This is the class for pricing Ibor products using the LMM.
Methods
simulate_1f
simulate_1f(self, discount_curve, vol_curve: financepy.market.volatility.ibor_cap_vol_curve.IborCapVolCurve, num_paths: int = 1000, numeraire_index: int = 0, use_sobol: bool = True, seed: int = 42)
Run the one-factor simulation of the evolution of the forward
Ibors to generate and store all of the Ibor forward rate paths.
simulate_mf
simulate_mf(self, discount_curve, num_factors: int, lambdas: numpy.ndarray, num_paths: int = 10000, numeraire_index: int = 0, use_sobol: bool = True, seed: int = 42)
Run the simulation to generate and store all of the Ibor forward
rate paths. This is a multi-factorial version so the user must input
a numpy array consisting of a column for each factor and the number of
rows must equal the number of grid times on the underlying simulation
grid. CHECK THIS.
simulate_nf
simulate_nf(self, discount_curve, vol_curve: financepy.market.volatility.ibor_cap_vol_curve.IborCapVolCurve, corr_matrix: numpy.ndarray, model_type: financepy.utils.global_types.LMMModelTypes, num_paths: int = 1000, numeraire_index: int = 0, use_sobol: bool = True, seed: int = 42)
Run the simulation to generate and store all of the Ibor forward
rate paths using a full factor reduction of the fwd-fwd correlation
matrix using Cholesky decomposition.
value_swaption
value_swaption(self, settle_dt: financepy.utils.date.Date, exercise_dt: financepy.utils.date.Date, maturity_dt: financepy.utils.date.Date, swaption_type: financepy.utils.global_types.SwapTypes, fixed_cpn: float, fixed_freq_type: financepy.utils.frequency.FrequencyTypes, fixed_dc_type: financepy.utils.day_count.DayCountTypes, notional: float = 1000000, float_freq_type: financepy.utils.frequency.FrequencyTypes = <FrequencyTypes.QUARTERLY: 4>, float_dc_type: financepy.utils.day_count.DayCountTypes = <DayCountTypes.THIRTY_E_360: 2>, cal_type: financepy.utils.calendar.CalendarTypes = <CalendarTypes.WEEKEND: 2>, bd_type: financepy.utils.calendar.BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>, dg_type: financepy.utils.calendar.DateGenRuleTypes = <DateGenRuleTypes.BACKWARD: 2>)
Value a swaption in the LMM model using simulated paths of the
forward curve. This relies on pricing the fixed leg of the swap and
assuming that the floating leg will be worth par. As a result we only
need simulate Ibors with the frequency of the fixed leg.
value_cap_floor
value_cap_floor(self, settle_dt: financepy.utils.date.Date, maturity_dt: financepy.utils.date.Date, cap_floor_type: financepy.utils.global_types.CapFloorTypes, cap_floor_rate: float, freq_type: financepy.utils.frequency.FrequencyTypes = <FrequencyTypes.QUARTERLY: 4>, accrual_dc_type: financepy.utils.day_count.DayCountTypes = <DayCountTypes.ACT_360: 8>, notional: float = 1000000, cal_type: financepy.utils.calendar.CalendarTypes = <CalendarTypes.WEEKEND: 2>, bd_type: financepy.utils.calendar.BusDayAdjustTypes = <BusDayAdjustTypes.FOLLOWING: 2>, dg_type: financepy.utils.calendar.DateGenRuleTypes = <DateGenRuleTypes.BACKWARD: 2>)
Value a cap or floor in the LMM.
Generated automatically from the FinancePy source code.
Do not edit this file manually.