QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PathwiseVegasOuterAccountingEngine Class Reference

Engine collecting cash flows along a market-model simulation for doing pathwise computation of Deltas and vegas. More...

#include <pathwiseaccountingengine.hpp>

+ Collaboration diagram for PathwiseVegasOuterAccountingEngine:

Public Member Functions

 PathwiseVegasOuterAccountingEngine (ext::shared_ptr< LogNormalFwdRateEuler > evolver, const Clone< MarketModelPathwiseMultiProduct > &product, ext::shared_ptr< MarketModel > pseudoRootStructure, const std::vector< std::vector< Matrix > > &VegaBumps, Real initialNumeraireValue)
 
void multiplePathValues (std::vector< Real > &means, std::vector< Real > &errors, Size numberOfPaths)
 Use to get vegas with respect to VegaBumps. More...
 
void multiplePathValuesElementary (std::vector< Real > &means, std::vector< Real > &errors, Size numberOfPaths)
 Use to get vegas with respect to pseudo-root-elements. More...
 

Private Member Functions

Real singlePathValues (std::vector< Real > &values)
 

Private Attributes

ext::shared_ptr< LogNormalFwdRateEulerevolver_
 
Clone< MarketModelPathwiseMultiProductproduct_
 
ext::shared_ptr< MarketModelpseudoRootStructure_
 
std::vector< std::vector< Matrix > > vegaBumps_
 
std::vector< Sizenumeraires_
 
Real initialNumeraireValue_
 
Size numberProducts_
 
Size numberRates_
 
Size numberCashFlowTimes_
 
Size numberSteps_
 
Size factors_
 
Size numberBumps_
 
Size numberElementaryVegas_
 
std::vector< RatePseudoRootJacobianAllElementsjacobianComputers_
 
bool doDeflation_
 
std::vector< RealcurrentForwards_
 
std::vector< ReallastForwards_
 
std::vector< RealnumerairesHeld_
 
std::vector< SizenumberCashFlowsThisStep_
 
std::vector< std::vector< MarketModelPathwiseMultiProduct::CashFlow > > cashFlowsGenerated_
 
std::vector< MarketModelPathwiseDiscounterdiscounters_
 
std::vector< MatrixV_
 
Matrix LIBORRatios_
 
Matrix Discounts_
 
Matrix StepsDiscountsSquared_
 
std::vector< RealstepsDiscounts_
 
Matrix LIBORRates_
 
Matrix partials_
 
std::vector< std::vector< Matrix > > elementary_vegas_ThisPath_
 
std::vector< std::vector< Matrix > > jacobiansThisPaths_
 
std::vector< RealdeflatorAndDerivatives_
 
std::vector< RealfullDerivatives_
 
std::vector< std::vector< Size > > numberCashFlowsThisIndex_
 
std::vector< MatrixtotalCashFlowsThisIndex_
 
std::vector< std::vector< Size > > cashFlowIndicesThisStep_
 

Detailed Description

Engine collecting cash flows along a market-model simulation for doing pathwise computation of Deltas and vegas.

Examples
MarketModels.cpp.

Definition at line 196 of file pathwiseaccountingengine.hpp.

Constructor & Destructor Documentation

◆ PathwiseVegasOuterAccountingEngine()

PathwiseVegasOuterAccountingEngine ( ext::shared_ptr< LogNormalFwdRateEuler evolver,
const Clone< MarketModelPathwiseMultiProduct > &  product,
ext::shared_ptr< MarketModel pseudoRootStructure,
const std::vector< std::vector< Matrix > > &  VegaBumps,
Real  initialNumeraireValue 
)

Definition at line 713 of file pathwiseaccountingengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ multiplePathValues()

void multiplePathValues ( std::vector< Real > &  means,
std::vector< Real > &  errors,
Size  numberOfPaths 
)

Use to get vegas with respect to VegaBumps.

Definition at line 1146 of file pathwiseaccountingengine.cpp.

+ Here is the call graph for this function:

◆ multiplePathValuesElementary()

void multiplePathValuesElementary ( std::vector< Real > &  means,
std::vector< Real > &  errors,
Size  numberOfPaths 
)

Use to get vegas with respect to pseudo-root-elements.

Definition at line 1111 of file pathwiseaccountingengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ singlePathValues()

Real singlePathValues ( std::vector< Real > &  values)
private

Definition at line 861 of file pathwiseaccountingengine.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ evolver_

ext::shared_ptr<LogNormalFwdRateEuler> evolver_
private

Definition at line 220 of file pathwiseaccountingengine.hpp.

◆ product_

Definition at line 221 of file pathwiseaccountingengine.hpp.

◆ pseudoRootStructure_

ext::shared_ptr<MarketModel> pseudoRootStructure_
private

Definition at line 222 of file pathwiseaccountingengine.hpp.

◆ vegaBumps_

std::vector<std::vector<Matrix> > vegaBumps_
private

Definition at line 223 of file pathwiseaccountingengine.hpp.

◆ numeraires_

std::vector<Size> numeraires_
private

Definition at line 224 of file pathwiseaccountingengine.hpp.

◆ initialNumeraireValue_

Real initialNumeraireValue_
private

Definition at line 226 of file pathwiseaccountingengine.hpp.

◆ numberProducts_

Size numberProducts_
private

Definition at line 227 of file pathwiseaccountingengine.hpp.

◆ numberRates_

Size numberRates_
private

Definition at line 228 of file pathwiseaccountingengine.hpp.

◆ numberCashFlowTimes_

Size numberCashFlowTimes_
private

Definition at line 229 of file pathwiseaccountingengine.hpp.

◆ numberSteps_

Size numberSteps_
private

Definition at line 230 of file pathwiseaccountingengine.hpp.

◆ factors_

Size factors_
private

Definition at line 231 of file pathwiseaccountingengine.hpp.

◆ numberBumps_

Size numberBumps_
private

Definition at line 232 of file pathwiseaccountingengine.hpp.

◆ numberElementaryVegas_

Size numberElementaryVegas_
private

Definition at line 233 of file pathwiseaccountingengine.hpp.

◆ jacobianComputers_

std::vector<RatePseudoRootJacobianAllElements> jacobianComputers_
private

Definition at line 235 of file pathwiseaccountingengine.hpp.

◆ doDeflation_

bool doDeflation_
private

Definition at line 238 of file pathwiseaccountingengine.hpp.

◆ currentForwards_

std::vector<Real> currentForwards_
private

Definition at line 242 of file pathwiseaccountingengine.hpp.

◆ lastForwards_

std::vector<Real> lastForwards_
private

Definition at line 242 of file pathwiseaccountingengine.hpp.

◆ numerairesHeld_

std::vector<Real> numerairesHeld_
private

Definition at line 243 of file pathwiseaccountingengine.hpp.

◆ numberCashFlowsThisStep_

std::vector<Size> numberCashFlowsThisStep_
private

Definition at line 244 of file pathwiseaccountingengine.hpp.

◆ cashFlowsGenerated_

std::vector<std::vector<MarketModelPathwiseMultiProduct::CashFlow> > cashFlowsGenerated_
private

Definition at line 246 of file pathwiseaccountingengine.hpp.

◆ discounters_

std::vector<MarketModelPathwiseDiscounter> discounters_
private

Definition at line 247 of file pathwiseaccountingengine.hpp.

◆ V_

std::vector<Matrix> V_
private

Definition at line 249 of file pathwiseaccountingengine.hpp.

◆ LIBORRatios_

Matrix LIBORRatios_
private

Definition at line 251 of file pathwiseaccountingengine.hpp.

◆ Discounts_

Matrix Discounts_
private

Definition at line 252 of file pathwiseaccountingengine.hpp.

◆ StepsDiscountsSquared_

Matrix StepsDiscountsSquared_
private

Definition at line 254 of file pathwiseaccountingengine.hpp.

◆ stepsDiscounts_

std::vector<Real> stepsDiscounts_
private

Definition at line 255 of file pathwiseaccountingengine.hpp.

◆ LIBORRates_

Matrix LIBORRates_
private

Definition at line 257 of file pathwiseaccountingengine.hpp.

◆ partials_

Matrix partials_
private

Definition at line 258 of file pathwiseaccountingengine.hpp.

◆ elementary_vegas_ThisPath_

std::vector<std::vector<Matrix> > elementary_vegas_ThisPath_
private

Definition at line 260 of file pathwiseaccountingengine.hpp.

◆ jacobiansThisPaths_

std::vector<std::vector<Matrix> > jacobiansThisPaths_
private

Definition at line 261 of file pathwiseaccountingengine.hpp.

◆ deflatorAndDerivatives_

std::vector<Real> deflatorAndDerivatives_
private

Definition at line 263 of file pathwiseaccountingengine.hpp.

◆ fullDerivatives_

std::vector<Real> fullDerivatives_
private

Definition at line 264 of file pathwiseaccountingengine.hpp.

◆ numberCashFlowsThisIndex_

std::vector<std::vector<Size> > numberCashFlowsThisIndex_
private

Definition at line 266 of file pathwiseaccountingengine.hpp.

◆ totalCashFlowsThisIndex_

std::vector<Matrix> totalCashFlowsThisIndex_
private

Definition at line 267 of file pathwiseaccountingengine.hpp.

◆ cashFlowIndicesThisStep_

std::vector<std::vector<Size> > cashFlowIndicesThisStep_
private

Definition at line 269 of file pathwiseaccountingengine.hpp.