Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
SimmConcentrationCalibration Class Reference

Class giving the ISDA SIMM concentration thresholds as defined by a SIMM calibration. More...

#include <orea/simm/simmconcentrationcalibration.hpp>

+ Inheritance diagram for SimmConcentrationCalibration:
+ Collaboration diagram for SimmConcentrationCalibration:

Public Member Functions

 SimmConcentrationCalibration (const QuantLib::ext::shared_ptr< SimmCalibration > &simmCalibration, const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper)
 Default constructor that adds fixed known mappings. More...
 
QuantLib::Real threshold (const CrifRecord::RiskType &riskType, const std::string &qualifier) const override
 
- Public Member Functions inherited from SimmConcentrationBase
 SimmConcentrationBase ()
 
QuantLib::Real threshold (const CrifRecord::RiskType &riskType, const std::string &qualifier) const override
 
- Public Member Functions inherited from SimmConcentration
virtual ~SimmConcentration ()
 Destructor. More...
 
virtual QuantLib::Real threshold (const CrifRecord::RiskType &riskType, const std::string &qualifier) const =0
 

Private Attributes

QuantLib::ext::shared_ptr< SimmBucketMappersimmBucketMapper_
 Help getting SIMM buckets from SIMM qualifiers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SimmConcentrationBase
QuantLib::Real thresholdImpl (const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const CrifRecord::RiskType &riskType, const std::string &qualifier) const
 
QuantLib::Real fxVolThreshold (const std::string &fxPair) const
 Return concentration threshold for Risk_FXVol given the fxPair. More...
 
std::string category (const std::string &qualifier, const std::map< std::string, std::set< std::string > > &categories) const
 Find the concentration threshold category of the qualifier. More...
 
- Protected Attributes inherited from SimmConcentrationBase
QuantLib::Real units_
 The units of quotation of the threshold amount e.g. $1MM. More...
 
std::map< CrifRecord::RiskType, QuantLib::Real > flatThresholds_
 
std::map< CrifRecord::RiskType, std::map< std::string, QuantLib::Real > > bucketedThresholds_
 
std::map< std::string, std::set< std::string > > irCategories_
 
std::map< std::string, std::set< std::string > > fxCategories_
 
QuantLib::ext::shared_ptr< SimmBucketMappersimmBucketMapper_
 Maps SIMM qualifiers to SIMM buckets. More...
 

Detailed Description

Class giving the ISDA SIMM concentration thresholds as defined by a SIMM calibration.

Definition at line 38 of file simmconcentrationcalibration.hpp.

Constructor & Destructor Documentation

◆ SimmConcentrationCalibration()

SimmConcentrationCalibration ( const QuantLib::ext::shared_ptr< SimmCalibration > &  simmCalibration,
const QuantLib::ext::shared_ptr< SimmBucketMapper > &  simmBucketMapper 
)

Default constructor that adds fixed known mappings.

Definition at line 25 of file simmconcentrationcalibration.cpp.

27 : simmBucketMapper_(simmBucketMapper) {
28
29 for (const auto& [riskClass, rcData] : simmCalibration->riskClassData()) {
30
31 const auto& concThresholds = rcData->concentrationThresholds();
32
33 // IR and FX currency lists
34 if (riskClass == RiskClass::InterestRate || riskClass == RiskClass::FX) {
35 const auto& irFxThresholds = QuantLib::ext::dynamic_pointer_cast<IRFXConcentrationThresholds>(concThresholds);
36 QL_REQUIRE(irFxThresholds, "Cannot cast ConcentrationThresholds to IRFXConcentrationThresholds");
37 const auto& ccyLists = irFxThresholds->currencyLists();
38
39 auto& categories = riskClass == RiskClass::InterestRate ? irCategories_ : fxCategories_;
40 for (const auto& [ccyKey, ccyList] : ccyLists) {
41 const string& bucket = std::get<0>(ccyKey);
42 for (const string& ccy : ccyList) {
43 if (ccy == "Other") {
44 categories[bucket].clear();
45 } else {
46 categories[bucket].insert(ccy);
47 }
48 }
49 }
50 }
51
52 const auto& delta = concThresholds->delta();
53 const auto& vega = concThresholds->vega();
54
55 const auto& [deltaRiskType, vegaRiskType] = SimmConfiguration::riskClassToRiskType(riskClass);
56
57 // Delta concentration thresholds
58 if (delta.size() == 1) {
59 flatThresholds_[deltaRiskType] = ore::data::parseReal(delta.begin()->second);
60 } else if (delta.size() > 1) {
61 for (const auto& [key, dTh] : delta) {
62 const string& bucket = std::get<0>(key);
63 bucketedThresholds_[deltaRiskType][bucket] = ore::data::parseReal(dTh);
64 }
65 }
66
67 // Vega concentration thresholds
68 if (vega.size() == 1) {
69 flatThresholds_[vegaRiskType] = ore::data::parseReal(vega.begin()->second);
70 } else if (vega.size() > 1) {
71 for (const auto& [key, vTh] : vega) {
72 const string& bucket = std::get<0>(key);
73 bucketedThresholds_[vegaRiskType][bucket] = ore::data::parseReal(vTh);
74 }
75 }
76 }
77}
std::map< std::string, std::set< std::string > > fxCategories_
std::map< std::string, std::set< std::string > > irCategories_
std::map< CrifRecord::RiskType, std::map< std::string, QuantLib::Real > > bucketedThresholds_
std::map< CrifRecord::RiskType, QuantLib::Real > flatThresholds_
QuantLib::ext::shared_ptr< SimmBucketMapper > simmBucketMapper_
Help getting SIMM buckets from SIMM qualifiers.
static std::pair< CrifRecord::RiskType, CrifRecord::RiskType > riskClassToRiskType(const RiskClass &rc)
For a given risk class, return the corresponding risk types.
Real parseReal(const string &s)
+ Here is the call graph for this function:

Member Function Documentation

◆ threshold()

Real threshold ( const CrifRecord::RiskType riskType,
const std::string &  qualifier 
) const
overridevirtual

Return the SIMM concentration threshold for a given SIMM RiskType and SIMM Qualifier.

Warning:
If the risk type is not covered QL_MAX_REAL is returned i.e. no concentration threshold

Reimplemented from SimmConcentrationBase.

Definition at line 79 of file simmconcentrationcalibration.cpp.

79 {
80 return thresholdImpl(simmBucketMapper_, riskType, qualifier);
81}
QuantLib::Real thresholdImpl(const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const CrifRecord::RiskType &riskType, const std::string &qualifier) const
+ Here is the call graph for this function:

Member Data Documentation

◆ simmBucketMapper_

QuantLib::ext::shared_ptr<SimmBucketMapper> simmBucketMapper_
private

Help getting SIMM buckets from SIMM qualifiers.

Definition at line 54 of file simmconcentrationcalibration.hpp.