90 const QuantLib::ext::shared_ptr<ScenarioSimMarketParameters>& simMarketData,
91 const QuantLib::ext::weak_ptr<ScenarioSimMarket>& simMarket);
97 QuantLib::ext::shared_ptr<Scenario>
next(
const Date& d)
override;
140 const vector<Time>& shiftTimes,
142 const vector<Real>& values,
144 const vector<Time>& times,
146 vector<Real>& shiftedValues,
165 const vector<Time>& shiftX,
167 const vector<Time>& shiftY,
169 const vector<Time>& dataX,
171 const vector<Time>& dataY,
173 const vector<vector<Real>>& data,
175 vector<vector<Real>>& shiftedData,
199std::pair<RiskFactorKey, std::string>
deconstructFactor(
const std::string& factor);
205QuantLib::ext::shared_ptr<RiskFactorKey>
parseRiskFactorKey(
const std::string& str, std::vector<std::string>& addTokens);
Data types stored in the scenario class.
Scenario generator base class.
const Type & type() const
Inspectors.
string typeString() const
Return type as string.
ScenarioDescription(Type type)
Constructor.
const RiskFactorKey & key2() const
const string & indexDesc1() const
string factor2() const
Return key2 as string with text2 appended as key index description.
const string & indexDesc2() const
string factor1() const
Return key1 as string with text1 appended as key index description.
string factors() const
Return "factor1" and append ":factor2" if factor2 is not empty.
string keyName(RiskFactorKey key) const
ScenarioDescription(ScenarioDescription d1, ScenarioDescription d2)
const RiskFactorKey & key1() const
ScenarioDescription(Type type, RiskFactorKey key1, string indexDesc1)
Shift Scenario Generator.
std::vector< ScenarioDescription > scenarioDescriptions_
const QuantLib::ext::shared_ptr< Scenario > & baseScenario()
Return the base scenario, i.e. cached initial values of all relevant market points.
QuantLib::ext::shared_ptr< Scenario > baseScenario() const
return the base scenario
std::map< RiskFactorKey, std::string > keyToFactor_
Size samples()
Inspectors.
const std::vector< QuantLib::ext::shared_ptr< Scenario > > & scenarios()
Return vector of sensitivity scenarios, scenario 0 is the base scenario.
std::vector< QuantLib::ext::shared_ptr< Scenario > > scenarios_
const std::map< std::string, RiskFactorKey > & factorToKey()
Return revers map of factors to RiskFactorKeys.
std::vector< ScenarioDescription > scenarioDescriptions()
Return vector of scenario descriptions.
QuantLib::ext::shared_ptr< Scenario > next(const Date &d) override
Scenario Generator interface.
~ShiftScenarioGenerator()
Default destructor.
const QuantLib::ext::shared_ptr< Scenario > baseScenario_
void applyShift(Size j, Real shiftSize, bool up, ShiftType type, const vector< Time > &shiftTimes, const vector< Real > &values, const vector< Time > ×, vector< Real > &shiftedValues, bool initialise)
Apply 1d triangular shift to 1d data such as yield curves, public to allow test suite access.
const std::map< RiskFactorKey, std::string > & keyToFactor()
std::map< std::string, RiskFactorKey > factorToKey_
void reset() override
Reset the generator so calls to next() return the first scenario.
const QuantLib::ext::weak_ptr< ScenarioSimMarket > simMarket_
const QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > simMarketData_
bool operator<(const Dividend &d1, const Dividend &d2)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
bool operator==(const Dividend &d1, const Dividend &d)
string reconstructFactor(const RiskFactorKey &key, const string &desc)
Reconstruct the string description from a risk factor key and its index description desc.
RiskFactorKey parseRiskFactorKey(const string &str)
pair< RiskFactorKey, string > deconstructFactor(const string &factor)
factory classes for scenarios
Scenario generator base classes.
A Market class that can be updated by Scenarios.
A class to hold the parametrisation for building sensitivity scenarios.