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  RiskType {
  Commodity , CommodityVol , CreditNonQ , CreditQ ,
  CreditVol , CreditVolNonQ , Equity , EquityVol ,
  FX , FXVol , Inflation , IRCurve ,
  IRVol , InflationVol , BaseCorr , XCcyBasis ,
  ProductClassMultiplier , AddOnNotionalFactor , Notional , AddOnFixedAmount ,
  PV , All
}
 
enum class  MarginType {
  Delta , Vega , Curvature , BaseCorr ,
  AdditionalIM , All
}
 
enum class  ProductClass {
  RatesFX , Rates , FX , Credit ,
  Equity , Commodity , Empty , Other ,
  AddOnNotionalFactor , AddOnFixedAmount , 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 const std::string & name () const =0
 Returns the SIMM configuration name.
 
virtual const std::string & version () const =0
 Returns the SIMM configuration version.
 
virtual const boost::shared_ptr< SimmBucketMapper > & bucketMapper () const =0
 Returns the SIMM bucket mapper used by the configuration.
 
virtual std::vector< std::string > buckets (const RiskType &rt) const =0
 
virtual bool hasBuckets (const RiskType &rt) const =0
 Return true if the SIMM risk type rt has buckets.
 
virtual std::string bucket (const RiskType &rt, const std::string &qualifier) const =0
 
virtual std::vector< std::string > labels1 (const RiskType &rt) const =0
 
virtual std::vector< std::string > labels2 (const RiskType &rt) const =0
 
virtual std::string labels2 (const boost::shared_ptr< QuantLib::InterestRateIndex > &irIndex) const =0
 
virtual std::string labels2 (const QuantLib::Period &p) const =0
 
virtual void addLabels2 (const RiskType &rt, const std::string &label_2)=0
 
virtual QuantLib::Real weight (const 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 RiskType &rt, const std::string &label_1) const =0
 
virtual QuantLib::Real historicalVolatilityRatio (const RiskType &rt) const =0
 
virtual QuantLib::Real sigma (const 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 RiskType &rt, const std::string &qualifier) const =0
 
virtual bool isValidRiskType (const 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 RiskType &firstRt, const std::string &firstQualifier, const std::string &firstLabel_1, const std::string &firstLabel_2, const RiskType &secondRt, const std::string &secondQualifier, const std::string &secondLabel_1, const std::string &secondLabel_2, const std::string &calculationCurrency="") const =0
 

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< 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< ProductClassproductClasses (bool includeAll=false)
 Give back a set containing the ProductClass values optionally excluding 'All'.
 
static bool less_than (const ProductClass &lhs, const ProductClass &rhs)
 Define ordering for ProductClass according to a waterfall:
 
static bool greater_than (const ProductClass &lhs, const ProductClass &rhs)
 
static bool less_than_or_equal_to (const ProductClass &lhs, const ProductClass &rhs)
 
static bool greater_than_or_equal_to (const ProductClass &lhs, const ProductClass &rhs)
 
static ProductClass maxProductClass (ProductClass pc1, 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 numberOfRiskTypes
 Number of risk types including RiskType::All.
 
static const QuantLib::Size numberOfMarginTypes
 Number of margin types including MarginType::All.
 
static const QuantLib::Size numberOfProductClasses
 Number of product classes including ProductClass::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'

◆ RiskType

enum RiskType
strong

Risk types plus an All type for convenience Internal methods rely on the last element being 'All' Note that the risk type inflation has to be treated as an additional, single tenor bucket in IRCurve

◆ MarginType

enum MarginType
strong

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

◆ ProductClass

enum ProductClass
strong

Product class 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 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.

◆ bucket()

virtual std::string bucket ( const RiskType rt,
const std::string &  qualifier 
) const
pure virtual

Return the SIMM bucket name for the given risk type rt and qualifier

Warning:
Throws an error if there are no buckets for the risk type rt

Implemented in SimmConfigurationBase.

◆ labels1()

virtual std::vector<std::string> labels1 ( const 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() [1/3]

virtual std::vector<std::string> labels2 ( const 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.

◆ labels2() [2/3]

virtual std::string labels2 ( const boost::shared_ptr< QuantLib::InterestRateIndex > &  irIndex) const
pure virtual

Return the SIMM Label2 value for the given interest rate index irIndex. For interest rate indices, this is the SIMM sub curve name e.g. 'Libor1m', 'Libor3m' etc.

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, and SimmConfigurationBase.

◆ labels2() [3/3]

virtual std::string labels2 ( const QuantLib::Period &  p) const
pure virtual

Return the SIMM Label2 value for the given Libor tenor p. This is the SIMM sub curve name, e.g. 'Libor1m', 'Libor3m' etc.

Implemented in SimmConfigurationBase.

◆ addLabels2()

virtual void addLabels2 ( const 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, and SimmConfigurationBase.

◆ weight()

virtual QuantLib::Real weight ( const 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, and SimmConfigurationBase.

◆ curvatureWeight()

virtual QuantLib::Real curvatureWeight ( const 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 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 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 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 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 RiskType firstRt,
const std::string &  firstQualifier,
const std::string &  firstLabel_1,
const std::string &  firstLabel_2,
const 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, and SimmConfigurationBase.