Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CdoEngineBuilder Class Referenceabstract

#include <ored/portfolio/builders/cdo.hpp>

+ Inheritance diagram for CdoEngineBuilder:
+ Collaboration diagram for CdoEngineBuilder:

Public Member Functions

 CdoEngineBuilder (const std::string &model, const std::string &engine)
 
virtual QuantLib::ext::shared_ptr< QuantExt::DefaultLossModellossModel (const string &qualifier, const vector< Real > &recoveryRates, const Real &detachmentPoint, const QuantLib::Date &trancheMaturity, bool homogeneous)=0
 
CreditPortfolioSensitivityDecomposition sensitivityDecomposition () const
 
bool calibrateConstituentCurve () const
 
std::vector< QuantLib::Period > calibrationIndexTerms () const
 
bool optimizedSensitivityCalculation () const
 
- Public Member Functions inherited from CachingEngineBuilder< T, U, Args >
 CachingEngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
QuantLib::ext::shared_ptr< U > engine (Args... params)
 Return a PricingEngine or a FloatingRateCouponPricer. More...
 
void reset () override
 reset the builder (e.g. clear cache) More...
 
- Public Member Functions inherited from EngineBuilder
 EngineBuilder (const string &model, const string &engine, const set< string > &tradeTypes)
 
virtual ~EngineBuilder ()
 Virtual destructor. More...
 
const string & model () const
 Return the model name. More...
 
const string & engine () const
 Return the engine name. More...
 
const set< string > & tradeTypes () const
 Return the possible trade types. More...
 
const string & configuration (const MarketContext &key)
 Return a configuration (or the default one if key not found) More...
 
virtual void reset ()
 reset the builder (e.g. clear cache) More...
 
void init (const QuantLib::ext::shared_ptr< Market > market, const map< MarketContext, string > &configurations, const map< string, string > &modelParameters, const map< string, string > &engineParameters, const std::map< std::string, std::string > &globalParameters={})
 Initialise this Builder with the market and parameters to use. More...
 
const set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > & modelBuilders () const
 return model builders More...
 
std::string engineParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 
std::string modelParameter (const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
 

Protected Member Functions

virtual vector< string > keyImpl (const Currency &ccy, bool isIndexCDS, const vector< string > &creditCurves, const QuantLib::ext::shared_ptr< QuantLib::SimpleQuote > &calibrationFactor, const QuantLib::Real fixedRecovery) override
 
- Protected Member Functions inherited from CachingEngineBuilder< T, U, Args >
virtual T keyImpl (Args...)=0
 
virtual QuantLib::ext::shared_ptr< U > engineImpl (Args...)=0
 

Additional Inherited Members

- Protected Attributes inherited from CachingEngineBuilder< T, U, Args >
map< T, QuantLib::ext::shared_ptr< U > > engines_
 
- Protected Attributes inherited from EngineBuilder
string model_
 
string engine_
 
set< string > tradeTypes_
 
QuantLib::ext::shared_ptr< Marketmarket_
 
map< MarketContext, string > configurations_
 
map< string, string > modelParameters_
 
map< string, string > engineParameters_
 
std::map< std::string, std::string > globalParameters_
 
set< std::pair< string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > modelBuilders_
 

Detailed Description

Definition at line 59 of file cdo.hpp.

Constructor & Destructor Documentation

◆ CdoEngineBuilder()

CdoEngineBuilder ( const std::string &  model,
const std::string &  engine 
)

Definition at line 64 of file cdo.hpp.

65 : CachingEngineBuilder(model, engine, {"SyntheticCDO"}) {}
CachingEngineBuilder(const string &model, const string &engine, const set< string > &tradeTypes)
const string & engine() const
Return the engine name.
const string & model() const
Return the model name.

Member Function Documentation

◆ lossModel()

virtual QuantLib::ext::shared_ptr< QuantExt::DefaultLossModel > lossModel ( const string &  qualifier,
const vector< Real > &  recoveryRates,
const Real &  detachmentPoint,
const QuantLib::Date &  trancheMaturity,
bool  homogeneous 
)
pure virtual

◆ sensitivityDecomposition()

CreditPortfolioSensitivityDecomposition sensitivityDecomposition ( ) const

Definition at line 71 of file cdo.hpp.

71 {
73 engineParameter("SensitivityDecomposition", {}, false, "Underlying"));
74 }
std::string engineParameter(const std::string &p, const std::vector< std::string > &qualifiers={}, const bool mandatory=true, const std::string &defaultValue="") const
CreditPortfolioSensitivityDecomposition parseCreditPortfolioSensitivityDecomposition(const std::string &s)
Convert text to CreditPortfolioSensitivitiyDecomposition.
Definition: parsers.cpp:1374
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calibrateConstituentCurve()

bool calibrateConstituentCurve ( ) const

Definition at line 76 of file cdo.hpp.

76 {
77 return parseBool(engineParameter("calibrateConstituentCurves", {}, false, "false"));
78 }
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calibrationIndexTerms()

std::vector< QuantLib::Period > calibrationIndexTerms ( ) const

Definition at line 80 of file cdo.hpp.

80 {
81 return parseListOfValues<QuantLib::Period>(engineParameter("calibrationIndexTerms", {}, false, ""),
83 }
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
+ Here is the call graph for this function:

◆ optimizedSensitivityCalculation()

bool optimizedSensitivityCalculation ( ) const

Definition at line 85 of file cdo.hpp.

85 {
86 auto rt = globalParameters_.find("RunType");
88 (rt != globalParameters_.end() &&
89 (rt->second == "SensitivityDelta" || rt->second == "SensitivityDeltaGamma"));
90 }
CreditPortfolioSensitivityDecomposition sensitivityDecomposition() const
Definition: cdo.hpp:71
std::map< std::string, std::string > globalParameters_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ keyImpl()

virtual vector< string > keyImpl ( const Currency &  ccy,
bool  isIndexCDS,
const vector< string > &  creditCurves,
const QuantLib::ext::shared_ptr< QuantLib::SimpleQuote > &  calibrationFactor,
const QuantLib::Real  fixedRecovery 
)
overrideprotectedvirtual

Definition at line 93 of file cdo.hpp.

95 {
96 vector<string> res;
97 res.reserve(creditCurves.size() + 4);
98 res.emplace_back(ccy.code());
99 if (isIndexCDS)
100 res.emplace_back("_indexCDS");
101 res.insert(res.end(), creditCurves.begin(), creditCurves.end());
102 if (!close_enough(calibrationFactor->value(), 1.0) && calibrationFactor->value() != QuantLib::Null<Real>()) {
103 res.emplace_back(to_string(calibrationFactor->value()));
104 }
105 if (fixedRecovery != QuantLib::Null<QuantLib::Real>()) {
106 res.emplace_back(to_string(fixedRecovery));
107 }
108 return res;
109 }
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function: