Logo
Reference manual - version orea_version
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
SimmConfiguration Class Referenceabstract

Abstract base class defining the interface for a SIMM configuration. More...

#include <orea/simm/simmconfiguration.hpp>

+ Inheritance diagram for SimmConfiguration:

Public Types

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.
 

Public Member Functions

virtual std::vector< std::string > buckets (const CrifRecord::RiskType &rt) const =0
 
virtual bool hasBuckets (const CrifRecord::RiskType &rt) const =0
 Return true if the SIMM risk type rt has buckets.
 
bool hasBucketMapping (const CrifRecord::RiskType &rt, const std::string &qualifier) const override
 Return true if the SIMM risk type rt has buckets.
 
virtual std::vector< std::string > labels1 (const CrifRecord::RiskType &rt) const =0
 
virtual std::vector< std::string > labels2 (const CrifRecord::RiskType &rt) const =0
 
virtual void addLabels2 (const CrifRecord::RiskType &rt, const std::string &label_2)=0
 
virtual 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 =0
 
virtual QuantLib::Real curvatureWeight (const CrifRecord::RiskType &rt, const std::string &label_1) const =0
 
virtual QuantLib::Real historicalVolatilityRatio (const CrifRecord::RiskType &rt) const =0
 
virtual 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 =0
 
virtual QuantLib::Real curvatureMarginScaling () const =0
 
virtual QuantLib::Real concentrationThreshold (const CrifRecord::RiskType &rt, const std::string &qualifier) const =0
 
virtual bool isValidRiskType (const CrifRecord::RiskType &rt) const =0
 
virtual QuantLib::Real correlationRiskClasses (const RiskClass &rc_1, const RiskClass &rc_2) const =0
 Return the correlation between SIMM risk classes rc_1 and rc_2.
 
virtual 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 =0
 
virtual bool isSimmConfigCalibration () const
 
- Public Member Functions inherited from CrifConfiguration
virtual const std::string & name () const =0
 Returns the SIMM configuration name.
 
virtual const std::string & version () const =0
 Returns the SIMM configuration version.
 
virtual std::string bucket (const ore::analytics::CrifRecord::RiskType &rt, const std::string &qualifier) const =0
 
virtual const QuantLib::ext::shared_ptr< SimmBucketMapper > & bucketMapper () const =0
 Returns the SIMM bucket mapper used by the configuration.
 
virtual std::string label2 (const QuantLib::ext::shared_ptr< QuantLib::InterestRateIndex > &irIndex) const
 
virtual std::string label2 (const QuantLib::Period &p) const
 

Static Public Member Functions

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:
 

Static Protected Attributes

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

Abstract base class defining the interface for a SIMM configuration.

Member Enumeration Documentation

◆ RiskClass

enum RiskClass
strong

Risk class types in SIMM plus an All type for convenience

Warning:
The ordering here matters. It is used in indexing in to correlation matrices for the correlation between risk classes.
Warning:
Internal methods rely on the last element being 'All'

◆ MarginType

enum MarginType
strong

Margin types in SIMM plus an All type for convenience Internal methods rely on the last element being 'All'

Member Function Documentation

◆ buckets()

virtual std::vector<std::string> buckets ( const CrifRecord::RiskType rt) const
pure virtual

Return the SIMM bucket names for the given risk type rt An empty vector is returned if the risk type has no buckets

Implemented in SimmConfigurationBase.

◆ labels1()

virtual std::vector<std::string> labels1 ( const CrifRecord::RiskType rt) const
pure virtual

Return the list of SIMM Label1 values for risk type rt An empty vector is returned if the risk type does not use Label1

Implemented in SimmConfigurationBase.

◆ labels2()

virtual std::vector<std::string> labels2 ( const CrifRecord::RiskType rt) const
pure virtual

Return the list of SIMM Label2 values for risk type rt An empty vector is returned if the risk type does not use Label2

Implemented in SimmConfigurationBase.

◆ addLabels2()

virtual void addLabels2 ( const CrifRecord::RiskType rt,
const std::string &  label_2 
)
pure virtual

Add SIMM Label2 values under certain circumstances.

For example, in v338 and later, CreditQ label2 should have the payment currency if sensitivty is not the result of a securitisation and "payment currency,Sec" if sensitivty is the result of a securitisation. Adding to label2 in the configuration means you do not have to have an exhaustive list up front.

Implemented in SimmConfiguration_ISDA_V2_6, SimmConfiguration_ISDA_V2_5A, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_2, SimmConfiguration_ISDA_V2_1, SimmConfiguration_ISDA_V2_0, SimmConfiguration_ISDA_V1_3_38, SimmConfigurationCalibration, and SimmConfigurationBase.

◆ weight()

virtual 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
pure virtual

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

Implemented in SimmConfiguration_ISDA_V2_6, SimmConfiguration_ISDA_V2_5A, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_2, SimmConfigurationCalibration, and SimmConfigurationBase.

◆ curvatureWeight()

virtual QuantLib::Real curvatureWeight ( const CrifRecord::RiskType rt,
const std::string &  label_1 
) const
pure virtual

Gives back the value of the scaling function used in the calculation of curvature risk for the risk type rt with SIMM Label1 value label_1. The scaling function is:

\[ SF(t) = 0.5 \times \min \left(1, \frac{14}{t} \right) \]

where \(t\) is given in days.

Implemented in SimmConfigurationBase.

◆ historicalVolatilityRatio()

virtual QuantLib::Real historicalVolatilityRatio ( const CrifRecord::RiskType rt) const
pure virtual

Give back the SIMM historical volatility ratio for the risk type rt

Implemented in SimmConfigurationBase.

◆ sigma()

virtual 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
pure virtual

Give back the value of \(\sigma_{kj}\) from the SIMM docs for risk type rt. In general, rt is a volatility risk type and the method returns:

\[ \sigma_{kj} = \frac{RW_k \sqrt{\frac{365}{14}}}{\Phi^{-1}(0.99)} \]

where \(RW_k\) is the corresponding delta risk weight and \(\Phi(z)\) is the cumulative standard normal distribution.

Remarks
For convenience, returns 1.0 if not applicable for risk type rt

Implemented in SimmConfigurationBase.

◆ curvatureMarginScaling()

virtual QuantLib::Real curvatureMarginScaling ( ) const
pure virtual

◆ concentrationThreshold()

virtual QuantLib::Real concentrationThreshold ( const CrifRecord::RiskType rt,
const std::string &  qualifier 
) const
pure virtual

Give back the SIMM concentration threshold for the risk type rt and the SIMM qualifier

Implemented in SimmConfigurationBase.

◆ isValidRiskType()

virtual bool isValidRiskType ( const CrifRecord::RiskType rt) const
pure virtual

Return true if rt is a valid SIMM RiskType under the current configuration. Otherwise, return false.

Implemented in SimmConfigurationBase.

◆ correlation()

virtual 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
pure virtual

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

Warning:
Returns 0 if no correlation found

Implemented in SimmConfiguration_ISDA_V2_6, SimmConfiguration_ISDA_V2_5A, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_2, SimmConfigurationCalibration, and SimmConfigurationBase.