Numerical engine for flexi swaps in the LGM model. More...
#include <qle/pricingengines/numericlgmflexiswapengine.hpp>
Inheritance diagram for NumericLgmFlexiSwapEngineBase:Public Types | |
| enum class | Method { SwaptionArray , SingleSwaptions , Automatic } |
Public Member Functions | |
| NumericLgmFlexiSwapEngineBase (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Real sy, const Size ny, const Real sx, const Size nx, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Method method=Method::Automatic, const Real singleSwaptionThreshold=20.0) | |
Public Member Functions inherited from LgmConvolutionSolver | |
| LgmConvolutionSolver (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const Real sy, const Size ny, const Real sx, const Size nx) | |
| Size | gridSize () const |
| std::vector< Real > | stateGrid (const Real t) const |
| template<typename ValueType = Real> | |
| std::vector< ValueType > | rollback (const std::vector< ValueType > &v, const Real t1, const Real t0, const ValueType zero=ValueType(0.0)) const |
| const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > & | model () const |
Protected Member Functions | |
| std::pair< Real, Real > | calculate () const |
| Real | underlyingValue (const Real, const Real, const Date &, const Size, const Size, const Real, const Real) const |
Protected Attributes | |
| const Handle< YieldTermStructure > | discountCurve_ |
| const Method | method_ |
| const Real | singleSwaptionThreshold_ |
| QuantLib::ext::shared_ptr< IborIndex > | iborModelIndex_ |
| QuantLib::ext::shared_ptr< LgmImpliedYieldTermStructure > | iborModelCurve_ |
| VanillaSwap::Type | type |
| std::vector< Real > | fixedNominal |
| std::vector< Real > | floatingNominal |
| std::vector< Date > | fixedResetDates |
| std::vector< Date > | fixedPayDates |
| std::vector< Time > | floatingAccrualTimes |
| std::vector< Date > | floatingResetDates |
| std::vector< Date > | floatingFixingDates |
| std::vector< Date > | floatingPayDates |
| std::vector< Real > | fixedCoupons |
| std::vector< Real > | fixedRate |
| std::vector< Real > | floatingGearings |
| std::vector< Real > | floatingSpreads |
| std::vector< Real > | cappedRate |
| std::vector< Real > | flooredRate |
| std::vector< Real > | floatingCoupons |
| QuantLib::ext::shared_ptr< IborIndex > | iborIndex |
| std::vector< Real > | lowerNotionalBound |
| QuantLib::Position::Type | optionPosition |
| std::vector< bool > | notionalCanBeDecreased |
Numerical engine for flexi swaps in the LGM model.
This is a modifed version of qle/pricingengines/numericlgmswaptionengine.hpp Reference: F. Jamshidian, Replication of Flexi-swaps, January 2005
There are two implementations of the rollback
a) SingleSwaptions: price each swaption on its own, using the grid rollback b) SwaptionArray: price all swaptions simultaneously by rolling back suitable Arrays instead of Reals
For a large swaption basket b) is faster than a). The two methods can be specified explicitly or the Automatic mode can be used which uses a) if the "effective number of full swaptions" is below the given singleSwaptionThreshold and b) otherwise.
Here, the effective number of full swaptions is defined to be the sum of event dates of all the swaptions in the basket divided by the number of event dates of the full underlying.