29#include <boost/optional.hpp>
32#include <ql/indexes/interestrateindex.hpp>
33#include <ql/types.hpp>
95 static std::set<RiskClass>
riskClasses(
bool includeAll =
false);
98 static std::set<CrifRecord::RiskType>
riskTypes(
bool includeAll =
false);
101 static std::set<MarginType>
marginTypes(
bool includeAll =
false);
104 static std::set<CrifRecord::ProductClass>
productClasses(
bool includeAll =
false);
124 QL_REQUIRE(pc1 != CrifRecord::ProductClass::All && pc2 != CrifRecord::ProductClass::All,
125 "Cannot define worse product type if even one of the product classes is indeterminate.");
126 return (
less_than(pc1, pc2) ? pc2 : pc1);
169 boost::optional<std::string> label_1 = boost::none,
170 const std::string& calculationCurrency =
"")
const = 0;
196 boost::optional<std::string> label_1 = boost::none,
197 const std::string& calculationCurrency =
"")
const = 0;
226 const std::string& firstLabel_1,
const std::string& firstLabel_2,
228 const std::string& secondLabel_1,
const std::string& secondLabel_2,
229 const std::string& calculationCurrency =
"")
const = 0;
266 const std::set<std::string>& valueIfEmpty = {
"Unspecified"});
273std::string
removeRegulations(
const std::string& regsString,
const std::vector<std::string>& regsToRemove);
277std::string
filterRegulations(
const std::string& regsString,
const std::vector<std::string>& regsToFilter);
virtual const QuantLib::ext::shared_ptr< SimmBucketMapper > & bucketMapper() const =0
Returns the SIMM bucket mapper used by the configuration.
Abstract base class defining the interface for a SIMM configuration.
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.
static std::set< CrifRecord::RiskType > riskTypes(bool includeAll=false)
Give back a set containing the RiskType values optionally excluding 'All'.
static bool greater_than_or_equal_to(const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
static const QuantLib::Size numberOfRiskClasses
Number of risk classes including RiskClass::All.
static std::set< CrifRecord::ProductClass > productClasses(bool includeAll=false)
Give back a set containing the ProductClass values optionally excluding 'All'.
virtual bool isValidRiskType(const CrifRecord::RiskType &rt) const =0
virtual QuantLib::Real curvatureMarginScaling() const =0
static std::set< MarginType > marginTypes(bool includeAll=false)
Give back a set containing the MarginType values optionally excluding 'All'.
SimmSide
Enum indicating the relevant side of the SIMM calculation.
bool hasBucketMapping(const CrifRecord::RiskType &rt, const std::string &qualifier) const override
Return true if the SIMM risk type rt has buckets.
virtual bool isSimmConfigCalibration() const
static const QuantLib::Size numberOfMarginTypes
Number of margin types including MarginType::All.
static bool less_than(const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
Define ordering for ProductClass according to a waterfall:
virtual QuantLib::Real concentrationThreshold(const CrifRecord::RiskType &rt, const std::string &qualifier) const =0
virtual ~SimmConfiguration()
static bool less_than_or_equal_to(const CrifRecord::ProductClass &lhs, const CrifRecord::ProductClass &rhs)
static std::set< RiskClass > riskClasses(bool includeAll=false)
Give back a set containing the RiskClass values optionally excluding 'All'.
virtual std::vector< std::string > labels2(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.
static RiskClass riskTypeToRiskClass(const CrifRecord::RiskType &rt)
For a given rirsk type, return the corresponding risk class.
virtual QuantLib::Real curvatureWeight(const CrifRecord::RiskType &rt, const std::string &label_1) 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 std::vector< std::string > labels1(const CrifRecord::RiskType &rt) const =0
static const QuantLib::Size numberOfRegulations
Number of regulations.
virtual void addLabels2(const CrifRecord::RiskType &rt, const std::string &label_2)=0
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
Regulation
SIMM regulators.
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
static std::pair< CrifRecord::RiskType, CrifRecord::RiskType > riskClassToRiskType(const RiskClass &rc)
For a given risk class, return the corresponding risk types.
virtual QuantLib::Real historicalVolatilityRatio(const CrifRecord::RiskType &rt) const =0
static bool greater_than(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:
virtual std::vector< std::string > buckets(const CrifRecord::RiskType &rt) const =0
CRIF configuration interface.
Struct for holding a CRIF record.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
string combineRegulations(const string ®s1, const string ®s2)
SimmConfiguration::Regulation parseRegulation(const string ®ulation)
SimmConfiguration::SimmSide parseSimmSide(const string &side)
SimmConfiguration::Regulation getWinningRegulation(const std::vector< string > &winningRegulations)
From a vector of regulations, determine the winning regulation based on order of priority.
set< string > parseRegulationString(const string ®sString, const set< string > &valueIfEmpty)
Reads a string containing regulations applicable for a given CRIF record.
SimmConfiguration::IMModel parseIMModel(const string &model)
SimmConfiguration::RiskClass parseSimmRiskClass(const string &rc)
string filterRegulations(const string ®sString, const vector< string > ®sToFilter)
string removeRegulations(const string ®sString, const vector< string > ®sToRemove)
Removes a given vector of regulations from a string of regulations and returns a string with the regu...
SimmConfiguration::MarginType parseSimmMarginType(const string &mt)
string sortRegulationString(const string ®sString)