30#include <ql/math/matrix.hpp>
39 typedef std::map<std::tuple<std::string, std::string, std::string>, QuantLib::Real>
Amounts;
42 const std::string&
name()
const override {
return name_; }
58 const bool checkValue(
const std::string&,
const std::vector<std::string>&)
const;
84 boost::optional<std::string> label_1 = boost::none,
85 const std::string& calculationCurrency =
"")
const override;
115 boost::optional<std::string> label_1 = boost::none,
116 const std::string& calculationCurrency =
"")
const override;
150 const std::string& firstLabel_1,
const std::string& firstLabel_2,
152 const std::string& secondLabel_1,
const std::string& secondLabel_2,
153 const std::string& calculationCurrency =
"")
const override;
178 const std::tuple<std::string, std::string, std::string>
makeKey(
const std::string&,
const std::string&,
179 const std::string&)
const;
182 QuantLib::Size
labelIndex(
const std::string& label,
const std::vector<std::string>& labels)
const;
190 std::map<CrifRecord::RiskType, std::vector<std::string>>
mapBuckets_;
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
const std::tuple< std::string, std::string, std::string > makeKey(const std::string &, const std::string &, const std::string &) const
QuantLib::Real crqResidualIntraCorr_
Credit-Q residual intra correlation.
QuantLib::Real basecorrCorr_
Base correlation risk factor correlation.
std::vector< std::string > buckets(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.
std::map< CrifRecord::RiskType, QuantLib::Real > rwRiskType_
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::Size labelIndex(const std::string &label, const std::vector< std::string > &labels) const
Helper method to find the index of the label in labels.
std::string name_
Name of the SIMM configuration.
std::map< std::tuple< std::string, std::string, std::string >, QuantLib::Real > Amounts
QuantLib::Real crnqResidualIntraCorr_
Credit-NonQ residual intra correlation.
std::string version_
SIMM configuration version.
bool hasBuckets(const CrifRecord::RiskType &rt) const override
Return true if the SIMM risk type rt has buckets.
QuantLib::Size mporDays() const
MPOR in days.
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_2_
bool isValidRiskType(const CrifRecord::RiskType &rt) const override
QuantLib::Real curvatureMarginScaling() const override
QuantLib::Real irInterCurrencyCorr_
IR correlation across currencies.
std::vector< std::string > labels2(const CrifRecord::RiskType &rt) const override
std::map< CrifRecord::RiskType, Amounts > rwLabel_1_
std::map< CrifRecord::RiskType, Amounts > intraBucketCorrelation_
std::map< CrifRecord::RiskType, std::vector< std::string > > mapBuckets_
QuantLib::Real crnqDiffIntraCorr_
Credit-NonQ non-residual intra correlation when different underlying names.
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 crqSameIntraCorr_
Credit-Q non-residual intra correlation when same qualifier but different vertex/source.
const std::string & name() const override
Returns the SIMM configuration name.
QuantLib::Real crnqSameIntraCorr_
Credit-NonQ non-residual intra correlation when same underlying names.
std::vector< std::string > labels1(const CrifRecord::RiskType &rt) const override
const bool checkValue(const std::string &, const std::vector< std::string > &) const
void addLabels2(const CrifRecord::RiskType &rt, const std::string &label_2) override
Add SIMM Label2 values under certain circumstances.
std::set< CrifRecord::RiskType > validRiskTypes_
Set of valid risk types for the current configuration.
QuantLib::ext::shared_ptr< SimmConcentration > simmConcentration_
Used to get the concentration thresholds for a given risk type and qualifier.
QuantLib::Real sigmaMultiplier() const
Calculate variable for use in sigma method.
QuantLib::Real curvatureWeight(const CrifRecord::RiskType &rt, const std::string &label_1) const override
QuantLib::Real fxCorr_
FX correlation.
const QuantLib::ext::shared_ptr< SimmBucketMapper > & bucketMapper() const override
Returns the SIMM bucket mapper used by the configuration.
QuantLib::Real infCorr_
Correlation between any yield and inflation in same currency.
Amounts riskClassCorrelation_
Risk class correlation matrix.
QuantLib::Real crnqInterCorr_
Credit-NonQ non-residual inter bucket correlation.
const std::string & version() const override
Returns the SIMM configuration version.
std::map< CrifRecord::RiskType, QuantLib::Real > historicalVolatilityRatios_
Map from risk type to a historical volatility ratio.
std::map< CrifRecord::RiskType, Amounts > interBucketCorrelation_
std::map< CrifRecord::RiskType, std::vector< std::string > > mapLabels_1_
QuantLib::Real infVolCorr_
Correlation between any yield volatility and inflation volatility in same currency.
QuantLib::Real crqDiffIntraCorr_
Credit-Q non-residual intra correlation when different qualifier.
QuantLib::Real irSubCurveCorr_
IR Label2 level i.e. sub-curve correlation.
QuantLib::Real historicalVolatilityRatio(const CrifRecord::RiskType &rt) const override
void addLabels2Impl(const CrifRecord::RiskType &rt, const std::string &label_2)
A base implementation of addLabels2 that can be shared by derived classes.
QuantLib::Real concentrationThreshold(const CrifRecord::RiskType &rt, const std::string &qualifier) const override
std::map< CrifRecord::RiskType, std::vector< QuantLib::Real > > curvatureWeights_
QuantLib::ext::shared_ptr< SimmBucketMapper > simmBucketMapper_
Used to map SIMM Qualifier names to SIMM bucket values.
std::string bucket(const CrifRecord::RiskType &rt, const std::string &qualifier) const override
std::map< CrifRecord::RiskType, Amounts > rwBucket_
Abstract base class defining the interface for a SIMM configuration.
Abstract base class for classes that map SIMM qualifiers to buckets.
SIMM class for defining SIMM risk weights, thresholds, buckets, and labels. Currently only supports t...
Abstract base class for retrieving SIMM concentration thresholds.
SIMM configuration interface.