28#include <ql/time/daycounters/actualactual.hpp>
29#include <ql/types.hpp>
121 correlations_ = QuantLib::ext::make_shared<InstantaneousCorrelations>();
126 const vector<QuantLib::ext::shared_ptr<IrModelData>>&
irConfigs,
128 const vector<QuantLib::ext::shared_ptr<FxBsData>>&
fxConfigs,
130 const std::map<
CorrelationKey, QuantLib::Handle<QuantLib::Quote>>& c,
132 Real tolerance = 1e-4,
134 const std::string&
measure =
"LGM",
139 correlations_ = QuantLib::ext::make_shared<InstantaneousCorrelations>(c);
149 const std::vector<QuantLib::ext::shared_ptr<IrModelData>>&
irConfigs,
151 const std::vector<QuantLib::ext::shared_ptr<FxBsData>>&
fxConfigs,
153 const std::vector<QuantLib::ext::shared_ptr<EqBsData>>&
eqConfigs,
155 const std::map<
CorrelationKey, QuantLib::Handle<QuantLib::Quote>>& c,
157 Real tolerance = 1e-4,
159 const std::string&
measure =
"LGM",
164 correlations_ = QuantLib::ext::make_shared<InstantaneousCorrelations>(c);
174 const std::vector<QuantLib::ext::shared_ptr<IrModelData>>&
irConfigs,
176 const std::vector<QuantLib::ext::shared_ptr<FxBsData>>&
fxConfigs,
178 const std::vector<QuantLib::ext::shared_ptr<EqBsData>>&
eqConfigs,
180 const std::vector<QuantLib::ext::shared_ptr<InflationModelData>>&
infConfigs,
182 const std::vector<QuantLib::ext::shared_ptr<CrLgmData>>&
crLgmConfigs,
184 const std::vector<QuantLib::ext::shared_ptr<CrCirData>>&
crCirConfigs,
186 const std::vector<QuantLib::ext::shared_ptr<CommoditySchwartzData>>&
comConfigs,
190 const std::map<
CorrelationKey, QuantLib::Handle<QuantLib::Quote>>& c,
192 Real tolerance = 1e-4,
194 const std::string&
measure =
"LGM",
201 correlations_ = QuantLib::ext::make_shared<InstantaneousCorrelations>(c);
232 const std::map<CorrelationKey, QuantLib::Handle<QuantLib::Quote>>&
correlations()
const {
256 correlations_ = QuantLib::ext::make_shared<InstantaneousCorrelations>(corrs);
277 void buildIrConfigs(map<
string, QuantLib::ext::shared_ptr<IrModelData>>& irMap);
279 void buildFxConfigs(std::map<std::string, QuantLib::ext::shared_ptr<FxBsData>>& fxMap);
281 void buildEqConfigs(std::map<std::string, QuantLib::ext::shared_ptr<EqBsData>>& eqMap);
283 void buildInfConfigs(
const std::map<std::string, QuantLib::ext::shared_ptr<InflationModelData>>& mp);
285 void buildCrConfigs(std::map<std::string, QuantLib::ext::shared_ptr<CrLgmData>>& crLgmMap,
286 std::map<std::string, QuantLib::ext::shared_ptr<CrCirData>>& crCirMap);
288 void buildComConfigs(std::map<std::string, QuantLib::ext::shared_ptr<CommoditySchwartzData>>& comMap);
292 bool operator()(
const Handle<Quote>& x,
const Handle<Quote>& y)
const {
293 return x.currentLink() == y.currentLink();
306 vector<QuantLib::ext::shared_ptr<InflationModelData>>
infConfigs_;
309 vector<QuantLib::ext::shared_ptr<CommoditySchwartzData>>
comConfigs_;
Cross Asset Model Parameters.
vector< std::string > equities_
CrossAssetModel::Discretization & discretization()
const std::string & measure() const
const vector< QuantLib::ext::shared_ptr< CrCirData > > & crCirConfigs() const
const vector< string > & equities() const
QuantLib::ext::shared_ptr< InstantaneousCorrelations > correlations_
vector< QuantLib::ext::shared_ptr< InflationModelData > > & infConfigs()
const vector< QuantLib::ext::shared_ptr< EqBsData > > & eqConfigs() const
vector< string > & currencies()
CrossAssetModelData()
Default constructor.
void setCorrelations(const QuantLib::ext::shared_ptr< InstantaneousCorrelations > &corrs)
const vector< QuantLib::ext::shared_ptr< CrLgmData > > & crLgmConfigs() const
vector< QuantLib::ext::shared_ptr< IrModelData > > irConfigs_
vector< std::string > commodities_
vector< std::string > creditNames_
vector< string > & equities()
void validate()
Check consistency of config vectors.
void buildCrConfigs(std::map< std::string, QuantLib::ext::shared_ptr< CrLgmData > > &crLgmMap, std::map< std::string, QuantLib::ext::shared_ptr< CrCirData > > &crCirMap)
helper to convert CR LGM data, possibly including defaults, into CR config vectors
CrossAssetModelData(const std::vector< QuantLib::ext::shared_ptr< IrModelData > > &irConfigs, const std::vector< QuantLib::ext::shared_ptr< FxBsData > > &fxConfigs, const std::vector< QuantLib::ext::shared_ptr< EqBsData > > &eqConfigs, const std::vector< QuantLib::ext::shared_ptr< InflationModelData > > &infConfigs, const std::vector< QuantLib::ext::shared_ptr< CrLgmData > > &crLgmConfigs, const std::vector< QuantLib::ext::shared_ptr< CrCirData > > &crCirConfigs, const std::vector< QuantLib::ext::shared_ptr< CommoditySchwartzData > > &comConfigs, const Size numberOfCreditStates, const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &c, Real tolerance=1e-4, const std::string &measure="LGM", const CrossAssetModel::Discretization discretization=CrossAssetModel::Discretization::Exact)
Detailed constructor (all asset classes)
CrossAssetModel::Discretization discretization() const
const vector< string > & infIndices() const
void buildFxConfigs(std::map< std::string, QuantLib::ext::shared_ptr< FxBsData > > &fxMap)
helper to convert FX data, possibly including defaults, into an FX config vector
vector< string > & commodities()
vector< QuantLib::ext::shared_ptr< FxBsData > > & fxConfigs()
void buildComConfigs(std::map< std::string, QuantLib::ext::shared_ptr< CommoditySchwartzData > > &comMap)
helper to convert COM data, possibly including defaulta, into a COM config vector
vector< QuantLib::ext::shared_ptr< CrLgmData > > & crLgmConfigs()
virtual void fromXML(XMLNode *node) override
const vector< QuantLib::ext::shared_ptr< InflationModelData > > & infConfigs() const
virtual XMLNode * toXML(XMLDocument &doc) const override
Size numberOfCreditStates_
Real & bootstrapTolerance()
const vector< QuantLib::ext::shared_ptr< CommoditySchwartzData > > & comConfigs() const
vector< QuantLib::ext::shared_ptr< EqBsData > > & eqConfigs()
const vector< string > & currencies() const
vector< string > & creditNames()
void buildInfConfigs(const std::map< std::string, QuantLib::ext::shared_ptr< InflationModelData > > &mp)
helper to convert INF data, possibly including defaults, into an INF config vector
void setCorrelations(const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &corrs)
void buildIrConfigs(map< string, QuantLib::ext::shared_ptr< IrModelData > > &irMap)
helper to convert LGM data, possibly including defaults, into an IR config vector
bool operator==(const CrossAssetModelData &rhs)
CrossAssetModelData(const std::vector< QuantLib::ext::shared_ptr< IrModelData > > &irConfigs, const std::vector< QuantLib::ext::shared_ptr< FxBsData > > &fxConfigs, const std::vector< QuantLib::ext::shared_ptr< EqBsData > > &eqConfigs, const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &c, Real tolerance=1e-4, const std::string &measure="LGM", const CrossAssetModel::Discretization discretization=CrossAssetModel::Discretization::Exact)
Detailed constructor (IR/FX/EQ only)
vector< QuantLib::ext::shared_ptr< EqBsData > > eqConfigs_
bool operator!=(const CrossAssetModelData &rhs)
vector< QuantLib::ext::shared_ptr< CommoditySchwartzData > > comConfigs_
const string & domesticCurrency() const
string & domesticCurrency()
const vector< QuantLib::ext::shared_ptr< IrModelData > > & irConfigs() const
vector< QuantLib::ext::shared_ptr< CommoditySchwartzData > > & comConfigs()
const vector< QuantLib::ext::shared_ptr< FxBsData > > & fxConfigs() const
const vector< string > & creditNames() const
vector< QuantLib::ext::shared_ptr< CrCirData > > & crCirConfigs()
void clear()
Clear all vectors and maps.
vector< std::string > infindices_
vector< QuantLib::ext::shared_ptr< CrLgmData > > crLgmConfigs_
vector< std::string > currencies_
vector< QuantLib::ext::shared_ptr< CrCirData > > crCirConfigs_
vector< QuantLib::ext::shared_ptr< FxBsData > > fxConfigs_
Size numberOfCreditStates() const
vector< QuantLib::ext::shared_ptr< InflationModelData > > infConfigs_
const vector< string > & commodities() const
Real bootstrapTolerance() const
const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > & correlations() const
CrossAssetModelData(const vector< QuantLib::ext::shared_ptr< IrModelData > > &irConfigs, const vector< QuantLib::ext::shared_ptr< FxBsData > > &fxConfigs, const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &c, Real tolerance=1e-4, const std::string &measure="LGM", const CrossAssetModel::Discretization discretization=CrossAssetModel::Discretization::Exact)
Detailed constructor (IR/FX only)
vector< QuantLib::ext::shared_ptr< IrModelData > > & irConfigs()
CrossAssetModel::Discretization discretization_
void buildEqConfigs(std::map< std::string, QuantLib::ext::shared_ptr< EqBsData > > &eqMap)
helper to convert EQ data, possibly including defaults, into an EQ config vector
vector< string > & infIndices()
InstantaneousCorrelations.
InstantaneousCorrelations(const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &correlations)
Detailed constructor.
InstantaneousCorrelations()
Default constructor.
void correlations(const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > &corrs)
virtual void fromXML(XMLNode *node) override
Populate members from XML.
virtual XMLNode * toXML(XMLDocument &doc) const override
Write class members to XML.
std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > correlations_
bool operator==(const InstantaneousCorrelations &rhs)
bool operator!=(const InstantaneousCorrelations &rhs)
void clear()
Clear all vectors and maps.
const std::map< CorrelationKey, QuantLib::Handle< QuantLib::Quote > > & correlations() const
Small XML Document wrapper class.
Base class for all serializable classes.
COM component data for the cross asset model.
Currency and instrument specific conventions/defaults.
configuration class for building correlation matrices
CR component data for the cross asset model.
EQ component data for the cross asset model.
FX component data for the cross asset model.
base class for holding inflation model data
Generic interest rate model data.
QuantExt::CrossAssetModel::Discretization parseDiscretization(const string &s)
std::pair< CorrelationFactor, CorrelationFactor > CorrelationKey
Serializable Credit Default Swap.
bool operator()(const Handle< Quote > &x, const Handle< Quote > &y) const