Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
IMScheduleAnalytic Class Reference

#include <orea/app/analytics/imscheduleanalytic.hpp>

+ Inheritance diagram for IMScheduleAnalytic:
+ Collaboration diagram for IMScheduleAnalytic:

Public Member Functions

 IMScheduleAnalytic (const QuantLib::ext::shared_ptr< InputParameters > &inputs, const Crif &crif=Crif(), const bool hasNettingSetDetails=false)
 
const QuantLib::ext::shared_ptr< IMScheduleCalculator > & imSchedule () const
 
void setImSchedule (const QuantLib::ext::shared_ptr< IMScheduleCalculator > &imSchedule)
 
virtual void loadCrifRecords (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader)
 Load CRIF from external source, override to generate CRIF from the input portfolio. More...
 
const Crifcrif () const
 
bool hasNettingSetDetails () const
 
const std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > & hasSEC () const
 
const std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > & hasCFTC () const
 
- Public Member Functions inherited from Analytic
 Analytic ()
 Constructors. More...
 
 Analytic (std::unique_ptr< Impl > impl, const std::set< std::string > &analyticTypes, const QuantLib::ext::shared_ptr< InputParameters > &inputs, bool simulationConfig=false, bool sensitivityConfig=false, bool scenarioGeneratorConfig=false, bool crossAssetModelConfig=false)
 
virtual ~Analytic ()
 
virtual void runAnalytic (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::set< std::string > &runTypes={})
 Run only those analytic types that are inclcuded in the runTypes vector, run all if the runType vector is empty. More...
 
virtual void buildConfigurations (const bool=false)
 
virtual void setUpConfigurations ()
 
virtual void buildMarket (const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const bool marketRequired=true)
 
virtual void buildPortfolio ()
 
virtual void marketCalibration (const QuantLib::ext::shared_ptr< MarketCalibrationReportBase > &mcr=nullptr)
 
virtual void modifyPortfolio ()
 
virtual void replaceTrades ()
 
const std::string label () const
 Inspectors. More...
 
const std::set< std::string > & analyticTypes () const
 
const QuantLib::ext::shared_ptr< InputParameters > & inputs () const
 
const QuantLib::ext::shared_ptr< ore::data::Market > & market () const
 
QuantLib::ext::shared_ptr< MarketImplgetMarket () const
 
const QuantLib::ext::shared_ptr< ore::data::Portfolio > & portfolio () const
 
void setInputs (const QuantLib::ext::shared_ptr< InputParameters > &inputs)
 
void setMarket (const QuantLib::ext::shared_ptr< ore::data::Market > &market)
 
void setPortfolio (const QuantLib::ext::shared_ptr< ore::data::Portfolio > &portfolio)
 
std::vector< QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > > todaysMarketParams ()
 
const QuantLib::ext::shared_ptr< ore::data::Loader > & loader () const
 
Configurationsconfigurations ()
 
analytic_reportsreports ()
 Result reports. More...
 
analytic_npvcubesnpvCubes ()
 
analytic_mktcubesmktCubes ()
 
analytic_stresstestsstressTests ()
 
const bool getWriteIntermediateReports () const
 
void setWriteIntermediateReports (const bool flag)
 
bool match (const std::set< std::string > &runTypes)
 Check whether any of the requested run types is covered by this analytic. More...
 
const std::unique_ptr< Impl > & impl ()
 
std::set< QuantLib::Date > marketDates () const
 
std::vector< QuantLib::ext::shared_ptr< Analytic > > allDependentAnalytics () const
 

Private Attributes

Crif crif_
 
bool hasNettingSetDetails_ = false
 
std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > hasSEC_
 
std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > hasCFTC_
 
QuantLib::ext::shared_ptr< IMScheduleCalculatorimSchedule_
 

Additional Inherited Members

- Public Types inherited from Analytic
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< ore::data::InMemoryReport > > > analytic_reports
 
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< NPVCube > > > analytic_npvcubes
 
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< AggregationScenarioData > > > analytic_mktcubes
 
typedef std::map< std::string, std::map< std::string, QuantLib::ext::shared_ptr< StressTestScenarioData > > > analytic_stresstests
 
- Protected Attributes inherited from Analytic
std::unique_ptr< Implimpl_
 
std::set< std::string > types_
 list of analytic types run by this analytic More...
 
QuantLib::ext::shared_ptr< InputParametersinputs_
 contains all the input parameters for the run More...
 
Configurations configurations_
 
QuantLib::ext::shared_ptr< ore::data::Marketmarket_
 
QuantLib::ext::shared_ptr< ore::data::Loaderloader_
 
QuantLib::ext::shared_ptr< ore::data::Portfolioportfolio_
 
analytic_reports reports_
 
analytic_npvcubes npvCubes_
 
analytic_mktcubes mktCubes_
 
analytic_stresstests stressTests_
 
bool writeIntermediateReports_ = true
 

Detailed Description

Definition at line 43 of file imscheduleanalytic.hpp.

Constructor & Destructor Documentation

◆ IMScheduleAnalytic()

IMScheduleAnalytic ( const QuantLib::ext::shared_ptr< InputParameters > &  inputs,
const Crif crif = Crif(),
const bool  hasNettingSetDetails = false 
)

Definition at line 45 of file imscheduleanalytic.hpp.

48 : Analytic(std::make_unique<IMScheduleAnalyticImpl>(inputs), {"IM_SCHEDULE"}, inputs,
49 false, false, false, false),
const QuantLib::ext::shared_ptr< InputParameters > & inputs() const
Definition: analytic.hpp:116
Analytic()
Constructors.
Definition: analytic.hpp:79

Member Function Documentation

◆ imSchedule()

const QuantLib::ext::shared_ptr< IMScheduleCalculator > & imSchedule ( ) const

Definition at line 52 of file imscheduleanalytic.hpp.

52{ return imSchedule_; }
QuantLib::ext::shared_ptr< IMScheduleCalculator > imSchedule_
+ Here is the caller graph for this function:

◆ setImSchedule()

void setImSchedule ( const QuantLib::ext::shared_ptr< IMScheduleCalculator > &  imSchedule)

Definition at line 53 of file imscheduleanalytic.hpp.

const QuantLib::ext::shared_ptr< IMScheduleCalculator > & imSchedule() const
+ Here is the call graph for this function:

◆ loadCrifRecords()

void loadCrifRecords ( const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &  loader)
virtual

Load CRIF from external source, override to generate CRIF from the input portfolio.

Definition at line 29 of file imscheduleanalytic.cpp.

29 {
30 QL_REQUIRE(inputs_, "Inputs not set");
31 QL_REQUIRE(!inputs_->crif().empty(), "CRIF loader does not contain any records");
32
33 crif_ = inputs_->crif();
36
37 // Keep record of which netting sets have SEC and CFTC
38 map<string, bool> hasSECCache, hasCFTCCache;
39 for (const CrifRecord& cr : crif_) {
40 const NettingSetDetails& nsd = cr.nettingSetDetails;
41
42 for (const SimmConfiguration::SimmSide& side : {SimmConfiguration::SimmSide::Call, SimmConfiguration::SimmSide::Post}) {
43 const string& crifRegs = side == SimmConfiguration::SimmSide::Call ? cr.collectRegulations : cr.postRegulations;
44 for (const string& reg : {"SEC", "CFTC"}) {
45 map<string, bool>& regCache = reg == "SEC" ? hasSECCache : hasCFTCCache;
46 auto& hasRegMap = reg == "SEC" ? hasSEC_ : hasCFTC_;
47
48 if (hasRegMap[side].find(nsd) == hasRegMap[side].end()) {
49 bool hasReg = false;
50 if (regCache.find(crifRegs) != regCache.end()) {
51 hasReg = regCache.at(crifRegs);
52 } else {
53 set<string> regs = parseRegulationString(crifRegs);
54 hasReg = regs.find(reg) != regs.end();
55 regCache[crifRegs] = hasReg;
56 }
57 if (hasReg)
58 hasRegMap[side].insert(nsd);
59 }
60 }
61 }
62 }
63}
const QuantLib::ext::shared_ptr< ore::data::Market > & market() const
Definition: analytic.hpp:117
QuantLib::ext::shared_ptr< InputParameters > inputs_
contains all the input parameters for the run
Definition: analytic.hpp:156
bool hasNettingSetDetails() const
Check if netting set details are used anywhere, instead of just the netting set ID.
Definition: crif.cpp:342
void fillAmountUsd(const QuantLib::ext::shared_ptr< ore::data::Market > market)
Definition: crif.cpp:351
std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > hasSEC_
std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > hasCFTC_
SimmSide
Enum indicating the relevant side of the SIMM calculation.
set< string > parseRegulationString(const string &regsString, const set< string > &valueIfEmpty)
Reads a string containing regulations applicable for a given CRIF record.
+ Here is the call graph for this function:

◆ crif()

const Crif & crif ( ) const

Definition at line 58 of file imscheduleanalytic.hpp.

58{ return crif_; }

◆ hasNettingSetDetails()

bool hasNettingSetDetails ( ) const

Definition at line 59 of file imscheduleanalytic.hpp.

59{ return hasNettingSetDetails_; }

◆ hasSEC()

const std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > & hasSEC ( ) const

Definition at line 60 of file imscheduleanalytic.hpp.

60 {
61 return hasSEC_;
62 }

◆ hasCFTC()

const std::map< SimmConfiguration::SimmSide, std::set< ore::data::NettingSetDetails > > & hasCFTC ( ) const

Definition at line 63 of file imscheduleanalytic.hpp.

63 {
64 return hasCFTC_;
65 }

Member Data Documentation

◆ crif_

Crif crif_
private

Definition at line 67 of file imscheduleanalytic.hpp.

◆ hasNettingSetDetails_

bool hasNettingSetDetails_ = false
private

Definition at line 68 of file imscheduleanalytic.hpp.

◆ hasSEC_

std::map<SimmConfiguration::SimmSide, std::set<ore::data::NettingSetDetails> > hasSEC_
private

Definition at line 69 of file imscheduleanalytic.hpp.

◆ hasCFTC_

std::map<SimmConfiguration::SimmSide, std::set<ore::data::NettingSetDetails> > hasCFTC_
private

Definition at line 70 of file imscheduleanalytic.hpp.

◆ imSchedule_

QuantLib::ext::shared_ptr<IMScheduleCalculator> imSchedule_
private

Definition at line 71 of file imscheduleanalytic.hpp.