#include <orea/engine/sensitivityaggregator.hpp>
Public Types | |
typedef std::pair< RiskFactorKey, RiskFactorKey > | CrossPair |
Public Member Functions | |
SensitivityAggregator (const std::map< std::string, std::set< std::pair< std::string, QuantLib::Size >>> &categories) | |
SensitivityAggregator (const std::map< std::string, std::function< bool(std::string)>> &categories) | |
void | aggregate (SensitivityStream &ss, const QuantLib::ext::shared_ptr< ScenarioFilter > &filter=QuantLib::ext::make_shared< ScenarioFilter >()) |
void | reset () |
Reset the aggregator to it's initial state by clearing all aggregations. | |
const std::set< SensitivityRecord > & | sensitivities (const std::string &category) const |
void | generateDeltaGamma (const std::string &category, std::map< RiskFactorKey, QuantLib::Real > &deltas, std::map< CrossPair, QuantLib::Real > &gammas) |
Class for aggregating SensitivityRecords.
The SensitivityRecords are aggregated according to categories of predefined trade IDs.
typedef std::pair<RiskFactorKey, RiskFactorKey> CrossPair |
Return the deltas and gammas for the given category
SensitivityAggregator | ( | const std::map< std::string, std::set< std::pair< std::string, QuantLib::Size >>> & | categories | ) |
Constructor that uses sets of trades to define the aggregation categories.
The categories
map has a string key that defines the name of the category and a value that defines the set of trade IDs in that category.
SensitivityAggregator | ( | const std::map< std::string, std::function< bool(std::string)>> & | categories | ) |
Constructor that uses functions to define the aggregation categories.
The categories
map has a string key that defines the name of the category. The map value is a function that when given a trade ID, returns a bool indicating if the trade ID is in the category.
void aggregate | ( | SensitivityStream & | ss, |
const QuantLib::ext::shared_ptr< ScenarioFilter > & | filter = QuantLib::ext::make_shared< ScenarioFilter >() |
||
) |
Update the aggregator with SensitivityRecords from the stream ss
after applying the optional filter. If no filter is specified, all risk factors are aggregated.
const std::set<SensitivityRecord>& sensitivities | ( | const std::string & | category | ) | const |
Return the set of aggregated sensitivities for the given category