registerAsObserver
is left as a backdoor in case the programmer cannot guarantee that the object pointed to will remain alive for the whole lifetime of the handle—namely, it should be set to false
when the passed shared pointer does not own the pointee (this should only happen in a controlled environment, so that the programmer is aware of it). Failure to do so can very likely result in a program crash. If the programmer does want the handle to register as observer of such a shared pointer, it is his responsibility to ensure that the handle gets destroyed before the pointed object does. Settings::includeReferenceDateCashFlows()
is set to true
, payments occurring at the settlement date of the swap might be included in the NPV and therefore affect the fair-spread calculation. This might not be what you want. T
to Disposable<T>
is destructive, i.e., it does not preserve the state of the original object. Therefore, it is necessary for the developer to avoid code such as from
must be a later time than to
. from
must be a later time than to
. Objects cache the results of the previous calculation. Such results will be returned upon later invocations of calculate. When the results depend on arguments which could change between invocations, the lazy object must register itself as observer of such objects for the calculations to be performed again when they change.
Should this method be redefined in derived classes, LazyObject::calculate() should be called in the overriding method.
Should this method be redefined in derived classes, LazyObject::calculate() should be called in the overriding method.
The model requires a suitable input smile which means it should be arbitrage free, smooth (at least implying a C^1 call price function) and with a call price function not decreasing too slow in strike direction. A method for arbitrage free extra- and interpolation due to Kahale is provided and may be used to improve an input smile.
If you use the KahaleExtrapolation for smile pretreatment then this implies zero density for negative underlying rates. This means that in this case the market yield term structure must imply positive underlying atm forward rates. In principle the mf model is able to produce negative rates. To make this work the smileSection provided as input must have an digitalOptionPrice (or an optionPrice) implementation that is consistent with such a yield term structure and the model setting lowerRateBound must be set appropriately as a lower limit for the underlying rates.
If you do not use a smile pretreatment you should ensure that the input smileSection is arbitrage free and that the input smileSection covers the strikes from lowerRateBound to upperRateBound
The model assumes a monocurve setup. Workarounds for spreads between different forward curves or forward and discounting curve are at the moment left to be implemented in pricing engines. Note that this implies slightly different atm forward levels compared to a multicurve setup with e.g. OIS discounting and Ibor forwarding curves. The volatility structures feeded into the model should therefore be consistent with the monocurve assumption of the model.
The model uses a simplified formula for the npv of a swaps floating leg namely $P(t,T_0)-P(t,T_1)$ with $T_0$ being the start date of the leg and $T_1% being the last payment date, which is an approximation to the true npv.
The model calibrates to slightly modified market options in the sense that the start date is set equal to the fixing date, i.e. there is not delay. The model outputs refer to this modified instrument. This modification can be switched on and off in the models pricing functions via the flat zeroFixingDays. In general the actual market instrument including the delay is still matched very well though the calibration is done on a slightly different instrument in fact.
AdjustYts and AdjustDigitals are experimental options. Specifying AdjustYts may have a negative impact on the volatility smile match, so it should be used with special care. For long term calibration it seems an interesting option though.
NTL support must be enabled by defining MF_ENABLE_NTL in this file. For details on NTL see http://www.shoup.net/ntl/
A bad fit to the initial yield term structure may be due to a non suitable input smile or accumulating numerical errors in very long term calibrations. The former point is adressed by smile pretreatment options. The latter point may be tackled by higher values for the numerical parameters possibly together with NTL high precision computing.
The float leg is simplified in the sense that it is worth $P(t,T_0)-P(t,T_1)$ with $T_0$ and $T_1$ being the start date and end date of each caplet
Non zero spreads are not allowed
The float leg is simplified in the sense that it is worth $P(t,T_0)-P(t,T_1)$ with $T_0$ and $T_1$ being the start date and last payment date of the fixed leg schedule
Non zero spreads on the float leg is not allowed
Cash settled swaptions are not supported
registerAsObserver
. currently, this method returns the Black-Scholes implied volatility using analytic formulas for European options and a finite-difference method for American and Bermudan options. It will give unconsistent results if the pricing was performed with any other methods (such as jump-diffusion models.)
options with a gamma that changes sign (e.g., binary options) have values that are not monotonic in the volatility. In these cases, the calculation can fail and the result (if any) is almost meaningless. Another possible source of failure is to have a target value that is not attainable with any volatility, e.g., a target value lower than the intrinsic value in the case of American options.
Settings::includeReferenceDateCashFlows()
is set to true
, payments occurring at the settlement date of the swap might be included in the NPV and therefore affect the fair-rate and fair-spread calculation. This might not be what you want.