Abstract base class defining the interface for a SIMM configuration. More...
#include <orea/simm/simmconfiguration.hpp>
Public Types | |
enum class | SimmSide { Call , Post } |
Enum indicating the relevant side of the SIMM calculation. More... | |
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. More... | |
Public Member Functions | |
virtual | ~SimmConfiguration () |
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. More... | |
bool | hasBucketMapping (const CrifRecord::RiskType &rt, const std::string &qualifier) const override |
Return true if the SIMM risk type rt has buckets. More... | |
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 . More... | |
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 | ~CrifConfiguration () |
virtual const std::string & | name () const =0 |
Returns the SIMM configuration name. More... | |
virtual const std::string & | version () const =0 |
Returns the SIMM configuration version. More... | |
virtual std::string | bucket (const ore::analytics::CrifRecord::RiskType &rt, const std::string &qualifier) const =0 |
virtual bool | hasBucketMapping (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. More... | |
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< RiskClass > | riskClasses (bool includeAll=false) |
Give back a set containing the RiskClass values optionally excluding 'All'. More... | |
static std::set< CrifRecord::RiskType > | riskTypes (bool includeAll=false) |
Give back a set containing the RiskType values optionally excluding 'All'. More... | |
static std::set< MarginType > | marginTypes (bool includeAll=false) |
Give back a set containing the MarginType values optionally excluding 'All'. More... | |
static std::set< CrifRecord::ProductClass > | productClasses (bool includeAll=false) |
Give back a set containing the ProductClass values optionally excluding 'All'. More... | |
static std::pair< CrifRecord::RiskType, CrifRecord::RiskType > | riskClassToRiskType (const RiskClass &rc) |
For a given risk class, return the corresponding risk types. More... | |
static RiskClass | riskTypeToRiskClass (const CrifRecord::RiskType &rt) |
For a given rirsk type, return the corresponding risk class. More... | |
static bool | less_than (const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs) |
Define ordering for ProductClass according to a waterfall: More... | |
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: More... | |
Static Protected Attributes | |
static const QuantLib::Size | numberOfRiskClasses = riskClassMap.size() |
Number of risk classes including RiskClass::All. More... | |
static const QuantLib::Size | numberOfMarginTypes = marginTypeMap.size() |
Number of margin types including MarginType::All. More... | |
static const QuantLib::Size | numberOfRegulations = regulationsMap.size() |
Number of regulations. More... | |
Abstract base class defining the interface for a SIMM configuration.
Definition at line 39 of file simmconfiguration.hpp.
|
strong |
Enum indicating the relevant side of the SIMM calculation.
Enumerator | |
---|---|
Call | |
Post |
Definition at line 44 of file simmconfiguration.hpp.
|
strong |
Risk class types in SIMM plus an All type for convenience
Enumerator | |
---|---|
InterestRate | |
CreditQualifying | |
CreditNonQualifying | |
Equity | |
Commodity | |
FX | |
All |
Definition at line 53 of file simmconfiguration.hpp.
|
strong |
Margin types in SIMM plus an All type for convenience Internal methods rely on the last element being 'All'
Enumerator | |
---|---|
Delta | |
Vega | |
Curvature | |
BaseCorr | |
AdditionalIM | |
All |
Definition at line 59 of file simmconfiguration.hpp.
|
strong |
Enumerator | |
---|---|
Schedule | |
SIMM | |
SIMM_R | |
SIMM_P |
Definition at line 61 of file simmconfiguration.hpp.
enum Regulation |
SIMM regulators.
Enumerator | |
---|---|
APRA | |
CFTC | |
ESA | |
FINMA | |
KFSC | |
HKMA | |
JFSA | |
MAS | |
OSFI | |
RBI | |
SEC | |
SEC_unseg | |
USPR | |
NONREG | |
BACEN | |
SANT | |
SFC | |
UK | |
AMFQ | |
Included | |
Unspecified | |
Invalid |
Definition at line 69 of file simmconfiguration.hpp.
|
virtual |
Definition at line 41 of file simmconfiguration.hpp.
|
static |
Give back a set containing the RiskClass values optionally excluding 'All'.
Definition at line 91 of file simmconfiguration.cpp.
|
static |
Give back a set containing the RiskType values optionally excluding 'All'.
Definition at line 104 of file simmconfiguration.cpp.
|
static |
Give back a set containing the MarginType values optionally excluding 'All'.
Definition at line 138 of file simmconfiguration.cpp.
|
static |
Give back a set containing the ProductClass values optionally excluding 'All'.
Definition at line 151 of file simmconfiguration.cpp.
|
static |
For a given risk class, return the corresponding risk types.
Definition at line 173 of file simmconfiguration.cpp.
|
static |
For a given rirsk type, return the corresponding risk class.
Definition at line 207 of file simmconfiguration.cpp.
|
static |
Define ordering for ProductClass according to a waterfall:
Define ordering for ProductClass.
Definition at line 402 of file simmconfiguration.cpp.
|
static |
Definition at line 464 of file simmconfiguration.cpp.
|
static |
Definition at line 468 of file simmconfiguration.cpp.
|
static |
|
static |
Return the "worse" ProductClass using a waterfall logic:
Definition at line 123 of file simmconfiguration.hpp.
|
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.
|
pure virtual |
Return true if the SIMM risk type rt
has buckets.
Implemented in SimmConfigurationBase.
|
overridevirtual |
Return true if the SIMM risk type rt
has buckets.
Implements CrifConfiguration.
Definition at line 137 of file simmconfiguration.hpp.
|
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.
|
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.
|
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 SimmConfigurationBase, SimmConfigurationCalibration, SimmConfiguration_ISDA_V1_3_38, SimmConfiguration_ISDA_V2_0, SimmConfiguration_ISDA_V2_1, SimmConfiguration_ISDA_V2_2, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_5A, and SimmConfiguration_ISDA_V2_6.
|
pure virtual |
Return the SIMM risk weight for the given risk type rt
with the given qualifier
and the given label_1
. Three possibilities:
rt
rt
and qualifier
Implemented in SimmConfigurationBase, SimmConfigurationCalibration, SimmConfiguration_ISDA_V2_2, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_5A, and SimmConfiguration_ISDA_V2_6.
|
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.
|
pure virtual |
Give back the SIMM historical volatility ratio for the risk type rt
Implemented in SimmConfigurationBase.
|
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.
rt
Implemented in SimmConfigurationBase.
|
pure virtual |
Give back the scaling factor for the Interest Rate curvature margin
Implemented in SimmConfigurationBase, SimmConfigurationCalibration, SimmConfiguration_ISDA_V2_1, SimmConfiguration_ISDA_V2_2, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_5A, and SimmConfiguration_ISDA_V2_6.
|
pure virtual |
Give back the SIMM concentration threshold for the risk type rt
and the SIMM qualifier
Implemented in SimmConfigurationBase.
|
pure virtual |
Return true if rt
is a valid SIMM RiskType under the current configuration. Otherwise, return false.
Implemented in SimmConfigurationBase.
|
pure virtual |
Return the correlation between SIMM risk classes rc_1
and rc_2
.
Implemented in SimmConfigurationBase.
|
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
Implemented in SimmConfigurationBase, SimmConfigurationCalibration, SimmConfiguration_ISDA_V2_2, SimmConfiguration_ISDA_V2_3, SimmConfiguration_ISDA_V2_3_8, SimmConfiguration_ISDA_V2_5, SimmConfiguration_ISDA_V2_5A, and SimmConfiguration_ISDA_V2_6.
|
virtual |
Reimplemented in SimmConfigurationCalibration.
Definition at line 231 of file simmconfiguration.hpp.
|
staticprotected |
Number of risk classes including RiskClass::All.
Definition at line 235 of file simmconfiguration.hpp.
|
staticprotected |
Number of margin types including MarginType::All.
Definition at line 237 of file simmconfiguration.hpp.
|
staticprotected |
Number of regulations.
Definition at line 239 of file simmconfiguration.hpp.