38#include <ql/math/array.hpp>
39#include <ql/math/matrix.hpp>
47using QuantLib::Matrix;
49typedef std::pair<RiskFactorKey, RiskFactorKey>
CrossPair;
67 QuantLib::Size
samples = QuantLib::Null<QuantLib::Size>();
68 QuantLib::Size
seed = QuantLib::Null<QuantLib::Size>();
72 const std::map<RiskFactorKey, QuantLib::Real>& deltas,
73 const std::map<CrossPair, Real>& gammas,
const QuantLib::ext::shared_ptr<QuantExt::CovarianceSalvage>& covarianceSalvage,
74 const bool& includeGammaMargin,
const bool& includeDeltaMargin) :
79 QuantLib::Real
var(QuantLib::Real confidence,
const bool isCall =
true,
80 const std::set<std::pair<std::string, QuantLib::Size>>& tradeIds = {})
override;
85 const std::map<RiskFactorKey, QuantLib::Real>&
deltas_;
86 const std::map<CrossPair, QuantLib::Real>&
gammas_;
99 const std::string& baseCurrency,
100 const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
101 const std::string& portfolioFilter,
102 const std::vector<QuantLib::Real>&
p,
104 const bool salvageCovarianceMatrix, boost::optional<ore::data::TimePeriod> period,
105 std::unique_ptr<SensiRunArgs> sensiArgs =
nullptr,
const bool breakdown =
false);
108 const std::string& baseCurrency,
109 const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
110 const std::string& portfolioFilter,
111 const QuantLib::ext::shared_ptr<HistoricalScenarioGenerator>& hisScenGen,
112 const std::vector<QuantLib::Real>&
p,
114 const bool salvageCovarianceMatrix, boost::optional<ore::data::TimePeriod> period,
115 std::unique_ptr<SensiRunArgs> sensiArgs =
nullptr,
const bool breakdown =
false);
119 typedef std::pair<RiskFactorKey, RiskFactorKey>
CrossPair;
QuantLib::Real var(QuantLib::Real confidence, const bool isCall=true, const std::set< std::pair< std::string, QuantLib::Size > > &tradeIds={}) override
const bool & includeDeltaMargin_
const QuantLib::ext::shared_ptr< QuantExt::CovarianceSalvage > & covarianceSalvage_
ParametricVarCalculator(const ParametricVarParams ¶metricVarParams, const QuantLib::Matrix &omega, const std::map< RiskFactorKey, QuantLib::Real > &deltas, const std::map< CrossPair, Real > &gammas, const QuantLib::ext::shared_ptr< QuantExt::CovarianceSalvage > &covarianceSalvage, const bool &includeGammaMargin, const bool &includeDeltaMargin)
const QuantLib::Matrix & omega_
const std::map< CrossPair, QuantLib::Real > & gammas_
const std::map< RiskFactorKey, QuantLib::Real > & deltas_
const bool & includeGammaMargin_
const ParametricVarParams & parametricVarParams_
Parametric VaR Calculator.
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > simMarketConfig_
virtual ~ParametricVarReport()
ParametricVarCalculator::ParametricVarParams parametricVarParams_
The parameters to use for calculating the parametric VAR benchmark.
const QuantLib::ext::shared_ptr< SensitivityScenarioData > sensitivityConfig_
void createVarCalculator() override
ParametricVarReport(const std::string &baseCurrency, const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const std::string &portfolioFilter, const std::vector< QuantLib::Real > &p, const ParametricVarCalculator::ParametricVarParams ¶metricVarParams, const bool salvageCovarianceMatrix, boost::optional< ore::data::TimePeriod > period, std::unique_ptr< SensiRunArgs > sensiArgs=nullptr, const bool breakdown=false)
ParametricVarReport(const std::string &baseCurrency, const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const std::string &portfolioFilter, const QuantLib::ext::shared_ptr< HistoricalScenarioGenerator > &hisScenGen, const std::vector< QuantLib::Real > &p, const ParametricVarCalculator::ParametricVarParams ¶metricVarParams, const bool salvageCovarianceMatrix, boost::optional< ore::data::TimePeriod > period, std::unique_ptr< SensiRunArgs > sensiArgs=nullptr, const bool breakdown=false)
std::pair< RiskFactorKey, RiskFactorKey > CrossPair
bool salvageCovarianceMatrix_
const std::vector< Real > & p() const
scenario generator that builds from historical shifts
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
ParametricVarCalculator::ParametricVarParams::Method parseParametricVarMethod(const string &s)
std::pair< RiskFactorKey, RiskFactorKey > CrossPair
A class to hold Scenario parameters for scenarioSimMarket.
Class for aggregating SensitivityRecords.
A class to hold the parametrisation for building sensitivity scenarios.
Base class for sensitivity record streamer.
A container for holding the parametric VAR parameters.
ParametricVarParams(const std::string &m, QuantLib::Size samples, QuantLib::Size seed)
Base class for a var calculation.