Logo
Reference manual - version orea_version
Public Member Functions | List of all members
SimmConfigurationCalibration Class Reference

#include <orea/simm/simmconfigurationcalibration.hpp>

+ Inheritance diagram for SimmConfigurationCalibration:

Public Member Functions

 SimmConfigurationCalibration (const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const QuantLib::ext::shared_ptr< SimmCalibration > &simmCalibration, const QuantLib::Size &mporDays=10, const std::string &name="SIMM Calibration")
 
std::string label2 (const QuantLib::ext::shared_ptr< QuantLib::InterestRateIndex > &irIndex) const override
 Return the SIMM Label2 value for the given interest rate index.
 
void addLabels2 (const CrifRecord::RiskType &rt, const std::string &label_2) override
 Add SIMM Label2 values under certain circumstances.
 
QuantLib::Real curvatureMarginScaling () const override
 
QuantLib::Real weight (const CrifRecord::RiskType &rt, boost::optional< std::string > qualifier=boost::none, boost::optional< std::string > label_1=boost::none, const std::string &calculationCurrency="") const override
 
QuantLib::Real correlation (const CrifRecord::RiskType &firstRt, const std::string &firstQualifier, const std::string &firstLabel_1, const std::string &firstLabel_2, const CrifRecord::RiskType &secondRt, const std::string &secondQualifier, const std::string &secondLabel_1, const std::string &secondLabel_2, const std::string &calculationCurrency="") const override
 
virtual bool isSimmConfigCalibration () const override
 
- Public Member Functions inherited from SimmConfigurationBase
const std::string & name () const override
 Returns the SIMM configuration name.
 
const std::string & version () const override
 Returns the SIMM configuration version.
 
const QuantLib::ext::shared_ptr< SimmBucketMapper > & bucketMapper () const override
 Returns the SIMM bucket mapper used by the configuration.
 
bool hasBuckets (const CrifRecord::RiskType &rt) const override
 Return true if the SIMM risk type rt has buckets.
 
std::string bucket (const CrifRecord::RiskType &rt, const std::string &qualifier) const override
 
const bool checkValue (const std::string &, const std::vector< std::string > &) const
 
std::vector< std::string > buckets (const CrifRecord::RiskType &rt) const override
 
std::vector< std::string > labels1 (const CrifRecord::RiskType &rt) const override
 
std::vector< std::string > labels2 (const CrifRecord::RiskType &rt) const override
 
QuantLib::Real curvatureWeight (const CrifRecord::RiskType &rt, const std::string &label_1) const override
 
QuantLib::Real historicalVolatilityRatio (const CrifRecord::RiskType &rt) const override
 
QuantLib::Real sigma (const CrifRecord::RiskType &rt, boost::optional< std::string > qualifier=boost::none, boost::optional< std::string > label_1=boost::none, const std::string &calculationCurrency="") const override
 
QuantLib::Real concentrationThreshold (const CrifRecord::RiskType &rt, const std::string &qualifier) const override
 
bool isValidRiskType (const CrifRecord::RiskType &rt) const override
 
QuantLib::Real correlationRiskClasses (const RiskClass &rc_1, const RiskClass &rc_2) const override
 Return the correlation between SIMM risk classes rc_1 and rc_2.
 
QuantLib::Size mporDays () const
 MPOR in days.
 
- Public Member Functions inherited from SimmConfiguration
bool hasBucketMapping (const CrifRecord::RiskType &rt, const std::string &qualifier) const override
 Return true if the SIMM risk type rt has buckets.
 
- Public Member Functions inherited from CrifConfiguration
virtual std::string label2 (const QuantLib::Period &p) const
 

Additional Inherited Members

- Public Types inherited from SimmConfigurationBase
typedef std::map< std::tuple< std::string, std::string, std::string >, QuantLib::Real > Amounts
 
- Public Types inherited from SimmConfiguration
enum class  SimmSide { Call , Post }
 Enum indicating the relevant side of the SIMM calculation.
 
enum class  RiskClass {
  InterestRate , CreditQualifying , CreditNonQualifying , Equity ,
  Commodity , FX , All
}
 
enum class  MarginType {
  Delta , Vega , Curvature , BaseCorr ,
  AdditionalIM , All
}
 
enum class  IMModel { Schedule , SIMM , SIMM_R , SIMM_P }
 
enum  Regulation {
  APRA , CFTC , ESA , FINMA ,
  KFSC , HKMA , JFSA , MAS ,
  OSFI , RBI , SEC , SEC_unseg ,
  USPR , NONREG , BACEN , SANT ,
  SFC , UK , AMFQ , Included ,
  Unspecified , Invalid
}
 SIMM regulators.
 
- Static Public Member Functions inherited from SimmConfiguration
static std::set< RiskClassriskClasses (bool includeAll=false)
 Give back a set containing the RiskClass values optionally excluding 'All'.
 
static std::set< CrifRecord::RiskTyperiskTypes (bool includeAll=false)
 Give back a set containing the RiskType values optionally excluding 'All'.
 
static std::set< MarginTypemarginTypes (bool includeAll=false)
 Give back a set containing the MarginType values optionally excluding 'All'.
 
static std::set< CrifRecord::ProductClassproductClasses (bool includeAll=false)
 Give back a set containing the ProductClass values optionally excluding 'All'.
 
static std::pair< CrifRecord::RiskType, CrifRecord::RiskTyperiskClassToRiskType (const RiskClass &rc)
 For a given risk class, return the corresponding risk types.
 
static RiskClass riskTypeToRiskClass (const CrifRecord::RiskType &rt)
 For a given rirsk type, return the corresponding risk class.
 
static bool less_than (const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
 Define ordering for ProductClass according to a waterfall:
 
static bool greater_than (const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
 
static bool less_than_or_equal_to (const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
 
static bool greater_than_or_equal_to (const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
 
static CrifRecord::ProductClass maxProductClass (CrifRecord::ProductClass pc1, CrifRecord::ProductClass pc2)
 Return the "worse" ProductClass using a waterfall logic:
 
- Protected Member Functions inherited from SimmConfigurationBase
 SimmConfigurationBase (const QuantLib::ext::shared_ptr< SimmBucketMapper > &simmBucketMapper, const std::string &name, const std::string version, QuantLib::Size mporDays=10)
 Constructor taking the SIMM configuration name and version.
 
const std::tuple< std::string, std::string, std::string > makeKey (const std::string &, const std::string &, const std::string &) const
 
QuantLib::Size labelIndex (const std::string &label, const std::vector< std::string > &labels) const
 Helper method to find the index of the label in labels.
 
void addLabels2Impl (const CrifRecord::RiskType &rt, const std::string &label_2)
 A base implementation of addLabels2 that can be shared by derived classes.
 
- Protected Attributes inherited from SimmConfigurationBase
std::string version_
 SIMM configuration version.
 
QuantLib::ext::shared_ptr< SimmBucketMappersimmBucketMapper_
 Used to map SIMM Qualifier names to SIMM bucket values.
 
QuantLib::ext::shared_ptr< SimmConcentrationsimmConcentration_
 Used to get the concentration thresholds for a given risk type and qualifier.
 
std::map< CrifRecord::RiskType, std::vector< std::string > > mapBuckets_
 
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_1_
 
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_2_
 
std::map< CrifRecord::RiskType, QuantLib::Real > rwRiskType_
 
std::map< CrifRecord::RiskType, Amounts > rwBucket_
 
std::map< CrifRecord::RiskType, Amounts > rwLabel_1_
 
std::map< CrifRecord::RiskType, std::vector< QuantLib::Real > > curvatureWeights_
 
std::map< CrifRecord::RiskType, QuantLib::Real > historicalVolatilityRatios_
 Map from risk type to a historical volatility ratio.
 
std::set< CrifRecord::RiskTypevalidRiskTypes_
 Set of valid risk types for the current configuration.
 
Amounts riskClassCorrelation_
 Risk class correlation matrix.
 
std::map< CrifRecord::RiskType, Amounts > interBucketCorrelation_
 
std::map< CrifRecord::RiskType, Amounts > intraBucketCorrelation_
 
QuantLib::Size mporDays_
 
QuantLib::Real xccyCorr_
 
QuantLib::Real infCorr_
 Correlation between any yield and inflation in same currency.
 
QuantLib::Real infVolCorr_
 Correlation between any yield volatility and inflation volatility in same currency.
 
QuantLib::Real irSubCurveCorr_
 IR Label2 level i.e. sub-curve correlation.
 
QuantLib::Real irInterCurrencyCorr_
 IR correlation across currencies.
 
QuantLib::Real crqResidualIntraCorr_
 Credit-Q residual intra correlation.
 
QuantLib::Real crqSameIntraCorr_
 Credit-Q non-residual intra correlation when same qualifier but different vertex/source.
 
QuantLib::Real crqDiffIntraCorr_
 Credit-Q non-residual intra correlation when different qualifier.
 
QuantLib::Real crnqResidualIntraCorr_
 Credit-NonQ residual intra correlation.
 
QuantLib::Real crnqSameIntraCorr_
 Credit-NonQ non-residual intra correlation when same underlying names.
 
QuantLib::Real crnqDiffIntraCorr_
 Credit-NonQ non-residual intra correlation when different underlying names.
 
QuantLib::Real crnqInterCorr_
 Credit-NonQ non-residual inter bucket correlation.
 
QuantLib::Real fxCorr_
 FX correlation.
 
QuantLib::Real basecorrCorr_
 Base correlation risk factor correlation.
 
- Static Protected Attributes inherited from SimmConfiguration
static const QuantLib::Size numberOfRiskClasses
 Number of risk classes including RiskClass::All.
 
static const QuantLib::Size numberOfMarginTypes
 Number of margin types including MarginType::All.
 
static const QuantLib::Size numberOfRegulations
 Number of regulations.
 

Detailed Description

Class giving the SIMM configuration as outlined in the document ISDA SIMM Methodology, version 2.6. Effective Date: December 2, 2023.

Member Function Documentation

◆ curvatureMarginScaling()

QuantLib::Real curvatureMarginScaling ( ) const
overridevirtual

Give back the scaling factor for the Interest Rate curvature margin

Reimplemented from SimmConfigurationBase.

◆ weight()

QuantLib::Real weight ( const CrifRecord::RiskType rt,
boost::optional< std::string >  qualifier = boost::none,
boost::optional< std::string >  label_1 = boost::none,
const std::string &  calculationCurrency = "" 
) const
overridevirtual

Return the SIMM risk weight for the given risk type rt with the given qualifier and the given label_1. Three possibilities:

  1. there is a flat risk weight for the risk factor's RiskType so only need rt
  2. there is a qualifier-dependent risk weight for the risk factor's RiskType so need rt and qualifier
  3. there is a qualifier-dependent and label1-dependent risk weight for the risk factor's RiskType so need all three parameters

Reimplemented from SimmConfigurationBase.

◆ correlation()

QuantLib::Real correlation ( const CrifRecord::RiskType firstRt,
const std::string &  firstQualifier,
const std::string &  firstLabel_1,
const std::string &  firstLabel_2,
const CrifRecord::RiskType secondRt,
const std::string &  secondQualifier,
const std::string &  secondLabel_1,
const std::string &  secondLabel_2,
const std::string &  calculationCurrency = "" 
) const
overridevirtual

Return the correlation between the firstQualifier with risk type firstRt, Label1 value of firstLabel_1 and Label2 value of firstLabel_2 and the secondQualifier with risk type secondRt, Label1 value of secondLabel_1 and Label2 value of secondLabel_2

Remarks
if not using firstLabel_1 and secondLabel_1, just enter an empty string for both. Similarly for firstLabel_2 and secondLabel_2.
Warning:
Returns 0 if no correlation found

Reimplemented from SimmConfigurationBase.