Valuation Engine. More...
#include <orea/engine/valuationengine.hpp>
Classes | |
| struct | Errors |
Public Types | |
| enum class | ErrorPolicy { RemoveAll , RemoveSample } |
Public Member Functions | |
| ValuationEngine (const QuantLib::Date &today, const QuantLib::ext::shared_ptr< ore::data::DateGrid > &dg, const QuantLib::ext::shared_ptr< analytics::SimMarket > &simMarket, const set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > &modelBuilders=set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > >(), const bool recalibrate=true) | |
| Constructor. | |
| void | buildCube (const QuantLib::ext::shared_ptr< data::Portfolio > &portfolio, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCube, std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > calculators, const ErrorPolicy=ErrorPolicy::RemoveAll, bool mporStickyDate=true, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCubeNettingSet=nullptr, QuantLib::ext::shared_ptr< analytics::NPVCube > outputCptyCube=nullptr, std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator > > cptyCalculators={}, bool dryRun=false, Errors *errors=nullptr) |
| Build NPV cube. | |
Valuation Engine.
The valuation engine's purpose is to generate an NPV cube. Its buildCube loops over samples->dates->trades and prices the portfolio under all samples and dates.
The number of dates is defined by the DateGrid passed to the constructor. The number of trades is defined by the size of the portfolio passed to buildCube(). The number of samples is defined by the NPVCube that is passed to buildCube(), this can be dynamic.
In addition to storing the resulting NPVs it can be given any number of calculators that can store additional values in the cube.
| ValuationEngine | ( | const QuantLib::Date & | today, |
| const QuantLib::ext::shared_ptr< ore::data::DateGrid > & | dg, | ||
| const QuantLib::ext::shared_ptr< analytics::SimMarket > & | simMarket, | ||
| const set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > > & | modelBuilders = set< std::pair< std::string, QuantLib::ext::shared_ptr< QuantExt::ModelBuilder > > >(), | ||
| const bool | recalibrate = true ) |
Constructor.
| today | Valuation date |
| dg | Simulation date grid |
| simMarket | Simulated market object |
| modelBuilders | model builders to be updated |
| recalibrate | whether recalibrate() or newCalcWithoutCalibration() is called on model builders |
| void buildCube | ( | const QuantLib::ext::shared_ptr< data::Portfolio > & | portfolio, |
| QuantLib::ext::shared_ptr< analytics::NPVCube > | outputCube, | ||
| std::vector< QuantLib::ext::shared_ptr< ValuationCalculator > > | calculators, | ||
| const ErrorPolicy | = ErrorPolicy::RemoveAll, | ||
| bool | mporStickyDate = true, | ||
| QuantLib::ext::shared_ptr< analytics::NPVCube > | outputCubeNettingSet = nullptr, | ||
| QuantLib::ext::shared_ptr< analytics::NPVCube > | outputCptyCube = nullptr, | ||
| std::vector< QuantLib::ext::shared_ptr< CounterpartyCalculator > > | cptyCalculators = {}, | ||
| bool | dryRun = false, | ||
| Errors * | errors = nullptr ) |
Build NPV cube.
| portfolio | Portfolio to be priced |
| outputCube | Object for storing the results at trade level (e.g. NPVs, close-out NPVs, flows) |
| calculators | Calculators to use |
| mporStickyDate | Use sticky date in MPOR evaluation? |
| outputCubeNettingSet | Output cube for netting set-level results |
| outputCptyCube | Output cube for storing counterparty-level survival probabilities |
| cptyCalculators | Calculators for filling counterparty-level results |
| dryRun | Limit samples to one and fill the rest of the cube with random values |
| errors | errors |