|
29 | 29 | #include <ql/types.hpp> |
30 | 30 |
|
31 | 31 | #include <qle/models/lgm.hpp> |
| 32 | +#include <qle/pricingengines/analyticlgmswaptionengine.hpp> |
32 | 33 |
|
33 | 34 | #include <ored/configuration/conventions.hpp> |
34 | 35 | #include <ored/marketdata/market.hpp> |
@@ -82,11 +83,13 @@ class LgmData : public IrModelData { |
82 | 83 | ParamType aType, std::vector<Time> aTimes, std::vector<Real> aValues, Real shiftHorizon = 0.0, |
83 | 84 | Real scaling = 1.0, std::vector<std::string> optionExpiries = std::vector<std::string>(), |
84 | 85 | std::vector<std::string> optionTerms = std::vector<std::string>(), |
85 | | - std::vector<std::string> optionStrikes = std::vector<std::string>()) |
86 | | - : IrModelData("LGM", qualifier, calibrationType), revType_(revType), volType_(volType), |
87 | | - calibrateH_(calibrateH), hType_(hType), hTimes_(hTimes), hValues_(hValues), calibrateA_(calibrateA), |
88 | | - aType_(aType), aTimes_(aTimes), aValues_(aValues), shiftHorizon_(shiftHorizon), scaling_(scaling), |
89 | | - optionExpiries_(optionExpiries), optionTerms_(optionTerms), optionStrikes_(optionStrikes) {} |
| 86 | + std::vector<std::string> optionStrikes = std::vector<std::string>(), |
| 87 | + const QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping inputFloatSpreadMapping = |
| 88 | + QuantExt::AnalyticLgmSwaptionEngine::proRata) |
| 89 | + : IrModelData("LGM", qualifier, calibrationType), revType_(revType), volType_(volType), calibrateH_(calibrateH), |
| 90 | + hType_(hType), hTimes_(hTimes), hValues_(hValues), calibrateA_(calibrateA), aType_(aType), aTimes_(aTimes), |
| 91 | + aValues_(aValues), shiftHorizon_(shiftHorizon), scaling_(scaling), optionExpiries_(optionExpiries), |
| 92 | + optionTerms_(optionTerms), optionStrikes_(optionStrikes), floatSpreadMapping_(inputFloatSpreadMapping) {} |
90 | 93 |
|
91 | 94 | //! Clear list of calibration instruments |
92 | 95 | void clear() override; |
@@ -114,6 +117,7 @@ class LgmData : public IrModelData { |
114 | 117 | std::vector<Real>& aValues() { return aValues_; } |
115 | 118 | Real& shiftHorizon() { return shiftHorizon_; } |
116 | 119 | Real& scaling() { return scaling_; } |
| 120 | + QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping& floatSpreadMapping() { return floatSpreadMapping_; } |
117 | 121 | std::vector<std::string>& optionExpiries() const { return optionExpiries_; } |
118 | 122 | std::vector<std::string>& optionTerms() const { return optionTerms_; } |
119 | 123 | std::vector<std::string>& optionStrikes() const { return optionStrikes_; } |
@@ -142,15 +146,19 @@ class LgmData : public IrModelData { |
142 | 146 | mutable std::vector<std::string> optionExpiries_; |
143 | 147 | mutable std::vector<std::string> optionTerms_; |
144 | 148 | mutable std::vector<std::string> optionStrikes_; |
| 149 | + QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping floatSpreadMapping_ = |
| 150 | + QuantExt::AnalyticLgmSwaptionEngine::proRata; |
145 | 151 | }; |
146 | 152 |
|
147 | | -//! Enum parsers used in CrossAssetModelBuilder's fromXML |
| 153 | +//! Enum parsers |
148 | 154 | LgmData::ReversionType parseReversionType(const string& s); |
149 | 155 | LgmData::VolatilityType parseVolatilityType(const string& s); |
| 156 | +QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping parseFloatSpreadMapping(const string& s); |
150 | 157 |
|
151 | | -//! Enum to string used in CrossAssetModelBuilder's toXML |
| 158 | +//! Enum to string |
152 | 159 | std::ostream& operator<<(std::ostream& oss, const LgmData::ReversionType& type); |
153 | 160 | std::ostream& operator<<(std::ostream& oss, const LgmData::VolatilityType& type); |
| 161 | +std::ostream& operator<<(std::ostream& oss, const QuantExt::AnalyticLgmSwaptionEngine::FloatSpreadMapping& m); |
154 | 162 |
|
155 | 163 | /*! LGM reversion transformation. |
156 | 164 | |
|
0 commit comments