34#include <boost/optional.hpp>
43 XvaRunner(
const QuantLib::ext::shared_ptr<InputParameters>& inputs,
44 QuantLib::Date
asof,
const std::string& baseCurrency,
45 const QuantLib::ext::shared_ptr<ore::data::Portfolio>& portfolio,
46 const QuantLib::ext::shared_ptr<ore::data::NettingSetManager>& netting,
47 const QuantLib::ext::shared_ptr<ore::data::CollateralBalances>& collateralBalances,
48 const QuantLib::ext::shared_ptr<ore::data::EngineData>& engineData,
49 const QuantLib::ext::shared_ptr<ore::data::CurveConfigurations>& curveConfigs,
50 const QuantLib::ext::shared_ptr<ore::data::TodaysMarketParameters>& todaysMarketParams,
51 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& simMarketData,
52 const QuantLib::ext::shared_ptr<ScenarioGeneratorData>& scenarioGeneratorData,
53 const QuantLib::ext::shared_ptr<ore::data::CrossAssetModelData>& crossAssetModelData,
54 const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceData =
nullptr,
56 QuantLib::Real dimQuantile = 0.99, QuantLib::Size dimHorizonCalendarDays = 14,
57 map<string, bool> analytics = {},
string calculationType =
"Symmetric",
string dvaName =
"",
58 string fvaBorrowingCurve =
"",
string fvaLendingCurve =
"",
bool fullInitialCollateralisation =
true,
59 bool storeFlows =
false);
62 void runXva(
const QuantLib::ext::shared_ptr<ore::data::Market>& market,
bool continueOnErr =
true,
63 const std::map<std::string, QuantLib::Real>& currentIM = std::map<std::string, QuantLib::Real>());
69 void buildCamModel(
const QuantLib::ext::shared_ptr<ore::data::Market>& market,
bool continueOnErr =
true);
75 virtual void buildSimMarket(
const QuantLib::ext::shared_ptr<ore::data::Market>& market,
76 const boost::optional<std::set<std::string>>& currencyFilter = boost::none,
77 const bool continueOnErr =
true);
80 void buildCube(
const boost::optional<std::set<std::string>>& tradeIds,
bool continueOnErr =
true);
83 QuantLib::ext::shared_ptr<NPVCube>
npvCube()
const {
return cube_; }
93 const QuantLib::ext::shared_ptr<Market>& market,
const QuantLib::ext::shared_ptr<NPVCube>&
npvCube,
94 const QuantLib::ext::shared_ptr<NPVCube>&
nettingCube,
const QuantLib::ext::shared_ptr<AggregationScenarioData>& scenarioData,
95 const bool continueOnErr =
true,
96 const std::map<std::string, QuantLib::Real>& currentIM = std::map<std::string, QuantLib::Real>());
100 std::set<std::string>
getNettingSetIds(
const QuantLib::ext::shared_ptr<Portfolio>& portfolio =
nullptr)
const;
103 virtual QuantLib::ext::shared_ptr<NPVCube>
105 const QuantLib::ext::shared_ptr<Portfolio>& portfolio) {
109 virtual QuantLib::ext::shared_ptr<NPVCube>
getNpvCube(
const Date&
asof,
const std::set<std::string>& ids,
110 const std::vector<Date>& dates,
const Size samples,
111 const Size depth)
const;
113 virtual QuantLib::ext::shared_ptr<DynamicInitialMarginCalculator>
115 const QuantLib::ext::shared_ptr<CubeInterpretation>& cubeInterpreter,
116 const QuantLib::ext::shared_ptr<AggregationScenarioData>& scenarioData,
117 const QuantLib::ext::shared_ptr<QuantExt::CrossAssetModel>& model =
nullptr,
118 const QuantLib::ext::shared_ptr<NPVCube>&
nettingCube =
nullptr,
119 const std::map<std::string, QuantLib::Real>& currentIM = std::map<std::string, QuantLib::Real>());
121 virtual QuantLib::ext::shared_ptr<ore::analytics::ScenarioSimMarketParameters>
122 projectSsmData(
const std::set<std::string>& currencyFilter)
const;
125 const boost::optional<std::set<std::string>>& currencyFilter,
const QuantLib::ext::shared_ptr<Market>& market,
126 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& projectedSsmData,
127 const QuantLib::ext::shared_ptr<ScenarioFactory>& scenarioFactory,
const bool continueOnErr)
const;
129 QuantLib::ext::shared_ptr<InputParameters>
inputs_;
133 QuantLib::ext::shared_ptr<ore::data::NettingSetManager>
netting_;
154 QuantLib::ext::shared_ptr<QuantExt::CrossAssetModel>
model_;
163 QuantLib::ext::shared_ptr<std::vector<std::vector<QuantLib::Path>>>
bufferedPaths_;
QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > curveConfigs_
QuantLib::ext::shared_ptr< QuantExt::CrossAssetModel > model_
QuantLib::ext::shared_ptr< ore::data::TodaysMarketParameters > todaysMarketParams_
string fvaBorrowingCurve_
QuantLib::Size dimHorizonCalendarDays_
std::string calculationType_
QuantLib::ext::shared_ptr< CubeInterpretation > cubeInterpreter_
std::string baseCurrency_
void bufferSimulationPaths()
bool fullInitialCollateralisation_
QuantLib::ext::shared_ptr< ScenarioSimMarket > simMarket_
QuantLib::ext::shared_ptr< std::vector< std::vector< QuantLib::Path > > > bufferedPaths_
QuantLib::RelinkableHandle< AggregationScenarioData > scenarioData_
void runXva(const QuantLib::ext::shared_ptr< ore::data::Market > &market, bool continueOnErr=true, const std::map< std::string, QuantLib::Real > ¤tIM=std::map< std::string, QuantLib::Real >())
virtual QuantLib::ext::shared_ptr< NPVCube > getNpvCube(const Date &asof, const std::set< std::string > &ids, const std::vector< Date > &dates, const Size samples, const Size depth) const
string inputCalculationType_
void buildCamModel(const QuantLib::ext::shared_ptr< ore::data::Market > &market, bool continueOnErr=true)
const QuantLib::ext::shared_ptr< PostProcess > & postProcess()
QuantLib::ext::shared_ptr< NPVCube > npvCube() const
map< string, bool > analytics_
QuantLib::ext::shared_ptr< ore::data::Portfolio > portfolio_
QuantLib::ext::shared_ptr< ScenarioGeneratorData > scenarioGeneratorData_
std::set< std::string > getNettingSetIds(const QuantLib::ext::shared_ptr< Portfolio > &portfolio=nullptr) const
void generatePostProcessor(const QuantLib::ext::shared_ptr< Market > &market, const QuantLib::ext::shared_ptr< NPVCube > &npvCube, const QuantLib::ext::shared_ptr< NPVCube > &nettingCube, const QuantLib::ext::shared_ptr< AggregationScenarioData > &scenarioData, const bool continueOnErr=true, const std::map< std::string, QuantLib::Real > ¤tIM=std::map< std::string, QuantLib::Real >())
void buildCube(const boost::optional< std::set< std::string > > &tradeIds, bool continueOnErr=true)
QuantLib::Real dimQuantile_
QuantLib::Handle< AggregationScenarioData > aggregationScenarioData()
QuantLib::ext::shared_ptr< EngineFactory > simFactory_
virtual QuantLib::ext::shared_ptr< NPVCube > getNettingSetCube(std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > &calculators, const QuantLib::ext::shared_ptr< Portfolio > &portfolio)
virtual void buildSimMarket(const QuantLib::ext::shared_ptr< ore::data::Market > &market, const boost::optional< std::set< std::string > > ¤cyFilter=boost::none, const bool continueOnErr=true)
QuantLib::ext::shared_ptr< ore::data::CrossAssetModelData > crossAssetModelData_
QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > simMarketData_
IborFallbackConfig iborFallbackConfig_
QuantLib::ext::shared_ptr< ReferenceDataManager > referenceData_
QuantLib::ext::shared_ptr< NPVCube > nettingCube() const
virtual QuantLib::ext::shared_ptr< ore::analytics::ScenarioSimMarketParameters > projectSsmData(const std::set< std::string > ¤cyFilter) const
QuantLib::ext::shared_ptr< PostProcess > postProcess_
virtual QuantLib::ext::shared_ptr< ore::analytics::ScenarioGenerator > getProjectedScenarioGenerator(const boost::optional< std::set< std::string > > ¤cyFilter, const QuantLib::ext::shared_ptr< Market > &market, const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > &projectedSsmData, const QuantLib::ext::shared_ptr< ScenarioFactory > &scenarioFactory, const bool continueOnErr) const
QuantLib::ext::shared_ptr< InputParameters > inputs_
QuantLib::ext::shared_ptr< ore::data::NettingSetManager > netting_
QuantLib::ext::shared_ptr< ore::data::CollateralBalances > collateralBalances_
QuantLib::ext::shared_ptr< NPVCube > cube_
virtual QuantLib::ext::shared_ptr< DynamicInitialMarginCalculator > getDimCalculator(const QuantLib::ext::shared_ptr< NPVCube > &cube, const QuantLib::ext::shared_ptr< CubeInterpretation > &cubeInterpreter, const QuantLib::ext::shared_ptr< AggregationScenarioData > &scenarioData, const QuantLib::ext::shared_ptr< QuantExt::CrossAssetModel > &model=nullptr, const QuantLib::ext::shared_ptr< NPVCube > &nettingCube=nullptr, const std::map< std::string, QuantLib::Real > ¤tIM=std::map< std::string, QuantLib::Real >())
QuantLib::ext::shared_ptr< NPVCube > nettingCube_
QuantLib::ext::shared_ptr< ore::data::EngineData > engineData_
static IborFallbackConfig defaultConfig()
Exposure aggregation and XVA calculation.
Scenario generator configuration.
A class to hold Scenario parameters for scenarioSimMarket.
The counterparty cube calculator interface.