Class that wraps a sensitivity stream and decompose default, equity and commodity risk records given weights. More...
#include <orea/engine/decomposedsensitivitystream.hpp>
Inheritance diagram for DecomposedSensitivityStream:
Collaboration diagram for DecomposedSensitivityStream:Classes | |
| struct | IndexDecompositionResult |
Public Member Functions | |
| DecomposedSensitivityStream (const QuantLib::ext::shared_ptr< SensitivityStream > &ss, const std::string &baseCurrency, std::map< std::string, std::map< std::string, double > > defaultRiskDecompositionWeights={}, const std::set< std::string > &eqComDecompositionTradeIds={}, const std::map< std::string, std::map< std::string, double > > ¤cyHedgedIndexQuantities={}, const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > &refDataManager=nullptr, const QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > &curveConfigs=nullptr, const QuantLib::ext::shared_ptr< SensitivityScenarioData > &scenarioData=nullptr, const QuantLib::ext::shared_ptr< ore::data::Market > &todaysMarket=nullptr) | |
| SensitivityRecord | next () override |
| Returns the next SensitivityRecord in the stream after filtering. More... | |
| void | reset () override |
| Resets the stream so that SensitivityRecord objects can be streamed again. More... | |
Public Member Functions inherited from SensitivityStream | |
| virtual | ~SensitivityStream () |
| Destructor. More... | |
| virtual SensitivityRecord | next ()=0 |
| Returns the next SensitivityRecord in the stream. More... | |
| virtual void | reset ()=0 |
| Resets the stream so that SensitivityRecord objects can be streamed again. More... | |
Private Member Functions | |
| std::map< std::string, double > | constituentSpotRiskFromDecomposition (const double spotDelta, const std::map< std::string, double > &indexWeights) const |
| Decompose a equity/commodity spot sensitivity into the constituent spot sensistivities. More... | |
| std::map< std::string, double > | fxRiskFromDecomposition (const std::map< std::string, double > &spotRisk, const std::map< std::string, std::vector< std::string > > &constituentCurrencies, const std::map< std::string, double > &fxSpotShiftSize, const double eqShiftSize) const |
| Compute the resulting fx risks from a given equity/commodity decomposition. More... | |
| double | fxRiskShiftSize (const std::string ccy) const |
| Return the sensi shift size for the shifting the ccy-baseCurrency spot quote. More... | |
| std::map< std::string, double > | fxRiskShiftSizes (const std::map< std::string, std::vector< std::string > > &constituentCurrencies) const |
| Returns the shift sizes for all currencies in the map. More... | |
| double | assetSpotShiftSize (const std::string name, const ore::data::CurveSpec::CurveType curveType) const |
| Return the asset spot shift size. More... | |
| double | equitySpotShiftSize (const std::string name) const |
| double | commoditySpotShiftSize (const std::string name) const |
| std::map< std::string, std::vector< std::string > > | getConstituentCurrencies (const std::map< std::string, double > &constituents, const std::string &indexCurrency, const ore::data::CurveSpec::CurveType curveType) const |
| std::vector< SensitivityRecord > | decompose (const SensitivityRecord &record) const |
| Decompose the record and add it to the internal storage;. More... | |
| std::vector< SensitivityRecord > | decomposeSurvivalProbability (const SensitivityRecord &record) const |
| std::vector< SensitivityRecord > | decomposeCurrencyHedgedIndexRisk (const SensitivityRecord &record) const |
| IndexDecompositionResult | indexDecomposition (double delta, const std::string &indexName, const ore::data::CurveSpec::CurveType curveType) const |
| std::vector< SensitivityRecord > | sensitivityRecords (const std::map< std::string, double > &eqDeltas, const std::map< std::string, double > &fxDeltas, const std::string indexCurrency, const SensitivityRecord &orginialRecord) const |
| std::string | curveCurrency (const std::string &name, ore::data::CurveSpec::CurveType curveType) const |
Private Attributes | |
| std::vector< SensitivityRecord > | decomposedRecords_ |
| std::vector< SensitivityRecord >::iterator | itCurrent_ |
| QuantLib::ext::shared_ptr< SensitivityStream > | ss_ |
| The underlying sensitivity stream that has been wrapped. More... | |
| std::string | baseCurrency_ |
| std::map< std::string, std::map< std::string, double > > | defaultRiskDecompositionWeights_ |
| map of trade ids to the basket consituents with their resp. weights More... | |
| std::set< std::string > | eqComDecompositionTradeIds_ |
| list of trade id, for which a equity index decomposition should be applied More... | |
| std::map< std::string, std::map< std::string, double > > | currencyHedgedIndexQuantities_ |
| list of trade id, for which a commodity index decomposition should be applied More... | |
| QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > | refDataManager_ |
| refDataManager holding the equity and commodity index decomposition weights More... | |
| QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > | curveConfigs_ |
| QuantLib::ext::shared_ptr< SensitivityScenarioData > | ssd_ |
| QuantLib::ext::shared_ptr< ore::data::Market > | todaysMarket_ |
| bool | decompose_ |
Class that wraps a sensitivity stream and decompose default, equity and commodity risk records given weights.
Definition at line 38 of file decomposedsensitivitystream.hpp.
| DecomposedSensitivityStream | ( | const QuantLib::ext::shared_ptr< SensitivityStream > & | ss, |
| const std::string & | baseCurrency, | ||
| std::map< std::string, std::map< std::string, double > > | defaultRiskDecompositionWeights = {}, |
||
| const std::set< std::string > & | eqComDecompositionTradeIds = {}, |
||
| const std::map< std::string, std::map< std::string, double > > & | currencyHedgedIndexQuantities = {}, |
||
| const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > & | refDataManager = nullptr, |
||
| const QuantLib::ext::shared_ptr< ore::data::CurveConfigurations > & | curveConfigs = nullptr, |
||
| const QuantLib::ext::shared_ptr< SensitivityScenarioData > & | scenarioData = nullptr, |
||
| const QuantLib::ext::shared_ptr< ore::data::Market > & | todaysMarket = nullptr |
||
| ) |
Constructor providing the weights for the credit index decomposition and the ids and reference data used for
Definition at line 30 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
|
overridevirtual |
Returns the next SensitivityRecord in the stream after filtering.
Implements SensitivityStream.
Definition at line 48 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
|
overridevirtual |
Resets the stream so that SensitivityRecord objects can be streamed again.
Implements SensitivityStream.
Definition at line 319 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Decompose a equity/commodity spot sensitivity into the constituent spot sensistivities.
Decompose.
Definition at line 133 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Compute the resulting fx risks from a given equity/commodity decomposition.
Definition at line 142 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Return the sensi shift size for the shifting the ccy-baseCurrency spot quote.
Definition at line 159 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Returns the shift sizes for all currencies in the map.
Definition at line 169 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Return the asset spot shift size.
Definition at line 188 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 180 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Definition at line 200 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 214 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Decompose the record and add it to the internal storage;.
Definition at line 59 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 120 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Definition at line 262 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 237 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 326 of file decomposedsensitivitystream.cpp.
Here is the caller graph for this function:
|
private |
Definition at line 346 of file decomposedsensitivitystream.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 105 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 106 of file decomposedsensitivitystream.hpp.
|
private |
The underlying sensitivity stream that has been wrapped.
Definition at line 109 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 110 of file decomposedsensitivitystream.hpp.
|
private |
map of trade ids to the basket consituents with their resp. weights
Definition at line 112 of file decomposedsensitivitystream.hpp.
|
private |
list of trade id, for which a equity index decomposition should be applied
Definition at line 114 of file decomposedsensitivitystream.hpp.
|
private |
list of trade id, for which a commodity index decomposition should be applied
Definition at line 116 of file decomposedsensitivitystream.hpp.
|
private |
refDataManager holding the equity and commodity index decomposition weights
Definition at line 118 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 119 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 120 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 122 of file decomposedsensitivitystream.hpp.
|
private |
Definition at line 124 of file decomposedsensitivitystream.hpp.