#include <orea/scenario/deltascenario.hpp>
Public Member Functions | |
DeltaScenario () | |
Constructor. More... | |
DeltaScenario (const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &baseScenario, const QuantLib::ext::shared_ptr< ore::analytics::Scenario > &incrementalScenario) | |
Constructor. More... | |
const Date & | asof () const override |
Return the scenario asof date. More... | |
void | setAsof (const Date &d) override |
Set the asof date. More... | |
const std::string & | label () const override |
Return the scenario label. More... | |
void | label (const string &s) override |
set the label More... | |
Real | getNumeraire () const override |
Get Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ]. More... | |
void | setNumeraire (Real n) override |
Set the Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ]. More... | |
bool | has (const ore::analytics::RiskFactorKey &key) const override |
Check, get, add a single market point. More... | |
const std::vector< ore::analytics::RiskFactorKey > & | keys () const override |
Risk factor keys for which this scenario provides data. More... | |
void | add (const ore::analytics::RiskFactorKey &key, Real value) override |
Add an element to the scenario. More... | |
Real | get (const ore::analytics::RiskFactorKey &key) const override |
Get an element from the scenario. More... | |
bool | isAbsolute () const override |
Is this an absolute or difference scenario? More... | |
void | setAbsolute (const bool b) override |
Set if this is an absolute scenario. More... | |
const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > & | coordinates () const override |
Get coordinates. More... | |
QuantLib::ext::shared_ptr< Scenario > | base () const |
Get base. More... | |
QuantLib::ext::shared_ptr< Scenario > | delta () const |
Get delta. More... | |
QuantLib::ext::shared_ptr< Scenario > | clone () const override |
clones a scenario and returns a pointer to the new object More... | |
bool | isCloseEnough (const QuantLib::ext::shared_ptr< Scenario > &s) const override |
checks for equality up to numerical differences More... | |
Public Member Functions inherited from Scenario | |
virtual | ~Scenario () |
Destructor. More... | |
virtual const Date & | asof () const =0 |
Return the scenario asof date. More... | |
virtual void | setAsof (const Date &d)=0 |
Set the asof date. More... | |
virtual const string & | label () const =0 |
Get the scenario label. More... | |
virtual void | label (const string &)=0 |
Set the scenario label. More... | |
virtual Real | getNumeraire () const =0 |
Get Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ]. More... | |
virtual void | setNumeraire (Real n)=0 |
Set the Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ]. More... | |
virtual bool | has (const RiskFactorKey &key) const =0 |
Check whether this scenario provides the data for the given key. More... | |
virtual const std::vector< RiskFactorKey > & | keys () const =0 |
Risk factor keys for which this scenario provides data. More... | |
virtual void | add (const RiskFactorKey &key, Real value)=0 |
Add an element to the scenario. More... | |
virtual Real | get (const RiskFactorKey &key) const =0 |
Get an element from the scenario. More... | |
virtual bool | isAbsolute () const =0 |
Is this an absolute or difference scenario? More... | |
virtual void | setAbsolute (const bool b)=0 |
Set if this is an absolute scenario. More... | |
virtual const std::map< std::pair< RiskFactorKey::KeyType, std::string >, std::vector< std::vector< Real > > > & | coordinates () const =0 |
Get coordinates. More... | |
virtual QuantLib::ext::shared_ptr< Scenario > | clone () const =0 |
clones a scenario and returns a pointer to the new object More... | |
virtual bool | isCloseEnough (const QuantLib::ext::shared_ptr< Scenario > &s) const |
checks for equality up to numerical differences More... | |
virtual std::size_t | keysHash () const |
return fingerprint identifying the set of rf keys of the scenarios, or 0 if not provided by the implementation More... | |
Protected Attributes | |
QuantLib::ext::shared_ptr< Scenario > | baseScenario_ |
QuantLib::ext::shared_ptr< Scenario > | delta_ |
Delta Scenario class.
This implementation stores a pointer to a "base scenario", as well as a smaller "delta" scenario, which stores values for any keys where the value is different to base. This is intended as an efficient storage mechanism for e.g. sensitivity scenarios, where many scenario instances are managed in memory but the actual differences are minor.
Definition at line 41 of file deltascenario.hpp.
DeltaScenario | ( | ) |
DeltaScenario | ( | const QuantLib::ext::shared_ptr< ore::analytics::Scenario > & | baseScenario, |
const QuantLib::ext::shared_ptr< ore::analytics::Scenario > & | incrementalScenario | ||
) |
Constructor.
Definition at line 28 of file deltascenario.cpp.
|
overridevirtual |
Return the scenario asof date.
Implements Scenario.
Definition at line 49 of file deltascenario.hpp.
|
overridevirtual |
Set the asof date.
Implements Scenario.
Definition at line 50 of file deltascenario.hpp.
|
overridevirtual |
|
overridevirtual |
set the label
Implements Scenario.
Definition at line 55 of file deltascenario.hpp.
|
overridevirtual |
Get Numeraire ratio n = N(t) / N(0) so that Price(0) = N(0) * E [Price(t) / N(t) ].
Implements Scenario.
Definition at line 57 of file deltascenario.cpp.
|
overridevirtual |
|
overridevirtual |
Check, get, add a single market point.
Implements Scenario.
Definition at line 63 of file deltascenario.hpp.
|
overridevirtual |
Risk factor keys for which this scenario provides data.
Implements Scenario.
Definition at line 64 of file deltascenario.hpp.
|
overridevirtual |
Add an element to the scenario.
Implements Scenario.
Definition at line 37 of file deltascenario.cpp.
|
overridevirtual |
Get an element from the scenario.
Implements Scenario.
Definition at line 43 of file deltascenario.cpp.
|
overridevirtual |
Is this an absolute or difference scenario?
Implements Scenario.
Definition at line 68 of file deltascenario.hpp.
|
overridevirtual |
Set if this is an absolute scenario.
Implements Scenario.
Definition at line 69 of file deltascenario.hpp.
|
overridevirtual |
QuantLib::ext::shared_ptr< Scenario > base | ( | ) | const |
QuantLib::ext::shared_ptr< Scenario > delta | ( | ) | const |
|
overridevirtual |
clones a scenario and returns a pointer to the new object
Implements Scenario.
Definition at line 51 of file deltascenario.cpp.
checks for equality up to numerical differences
Reimplemented from Scenario.
Definition at line 64 of file deltascenario.cpp.
|
protected |
Definition at line 87 of file deltascenario.hpp.
|
protected |
Definition at line 88 of file deltascenario.hpp.