Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
McMultiLegOptionEngine Class Reference

#include <qle/pricingengines/mcmultilegoptionengine.hpp>

+ Inheritance diagram for McMultiLegOptionEngine:
+ Collaboration diagram for McMultiLegOptionEngine:

Public Member Functions

 McMultiLegOptionEngine (const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering=SobolBrownianGenerator::Steps, const SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
 
 McMultiLegOptionEngine (const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering=SobolBrownianGenerator::Steps, const SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7, const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
 
void calculate () const override
 
const Handle< CrossAssetModel > & model () const
 

Additional Inherited Members

- Public Types inherited from McMultiLegBaseEngine
enum  RegressorModel { Simple , LaggedFX }
 
- Protected Member Functions inherited from McMultiLegBaseEngine
 McMultiLegBaseEngine (const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering, const SobolRsg::DirectionIntegers directionIntegers, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
 
void calculate () const
 
QuantLib::ext::shared_ptr< AmcCalculatoramcCalculator () const
 
- Protected Attributes inherited from McMultiLegBaseEngine
std::vector< Leg > leg_
 
std::vector< Currency > currency_
 
std::vector< boolpayer_
 
QuantLib::ext::shared_ptr< Exercise > exercise_
 
Settlement::Type optionSettlement_ = Settlement::Physical
 
bool includeSettlementDateFlows_ = false
 
Handle< CrossAssetModelmodel_
 
SequenceType calibrationPathGenerator_
 
SequenceType pricingPathGenerator_
 
Size calibrationSamples_
 
Size pricingSamples_
 
Size calibrationSeed_
 
Size pricingSeed_
 
Size polynomOrder_
 
LsmBasisSystem::PolynomialType polynomType_
 
SobolBrownianGenerator::Ordering ordering_
 
SobolRsg::DirectionIntegers directionIntegers_
 
std::vector< Handle< YieldTermStructure > > discountCurves_
 
std::vector< Date > simulationDates_
 
std::vector< Size > externalModelIndices_
 
bool minimalObsDate_
 
RegressorModel regressorModel_
 
Real regressionVarianceCutoff_
 
QuantLib::ext::shared_ptr< AmcCalculatoramcCalculator_
 
Real resultUnderlyingNpv_
 
Real resultValue_
 

Detailed Description

Definition at line 35 of file mcmultilegoptionengine.hpp.

Constructor & Destructor Documentation

◆ McMultiLegOptionEngine() [1/2]

McMultiLegOptionEngine ( const Handle< CrossAssetModel > &  model,
const SequenceType  calibrationPathGenerator,
const SequenceType  pricingPathGenerator,
const Size  calibrationSamples,
const Size  pricingSamples,
const Size  calibrationSeed,
const Size  pricingSeed,
const Size  polynomOrder,
const LsmBasisSystem::PolynomialType  polynomType,
const SobolBrownianGenerator::Ordering  ordering = SobolBrownianGenerator::Steps,
const SobolRsg::DirectionIntegers  directionIntegers = SobolRsg::JoeKuoD7,
const std::vector< Handle< YieldTermStructure > > &  discountCurves = std::vector<Handle<YieldTermStructure>>(),
const std::vector< Date > &  simulationDates = std::vector<Date>(),
const std::vector< Size > &  externalModelIndices = std::vector<Size>(),
const bool  minimalObsDate = true,
const RegressorModel  regressorModel = RegressorModel::Simple,
const Real  regressionVarianceCutoff = Null<Real>() 
)

Definition at line 23 of file mcmultilegoptionengine.cpp.

31 : McMultiLegBaseEngine(model, calibrationPathGenerator, pricingPathGenerator, calibrationSamples, pricingSamples,
32 calibrationSeed, pricingSeed, polynomOrder, polynomType, ordering, directionIntegers,
33 discountCurves, simulationDates, externalModelIndices, minObsDate, regressorModel,
34 regressionVarianceCutoff) {
35 registerWith(model_);
36 for (auto& h : discountCurves_) {
37 registerWith(h);
38 }
39}
McMultiLegBaseEngine(const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering, const SobolRsg::DirectionIntegers directionIntegers, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())
std::vector< Handle< YieldTermStructure > > discountCurves_
Handle< CrossAssetModel > model_
const Handle< CrossAssetModel > & model() const

◆ McMultiLegOptionEngine() [2/2]

McMultiLegOptionEngine ( const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > &  model,
const SequenceType  calibrationPathGenerator,
const SequenceType  pricingPathGenerator,
const Size  calibrationSamples,
const Size  pricingSamples,
const Size  calibrationSeed,
const Size  pricingSeed,
const Size  polynomOrder,
const LsmBasisSystem::PolynomialType  polynomType,
const SobolBrownianGenerator::Ordering  ordering = SobolBrownianGenerator::Steps,
const SobolRsg::DirectionIntegers  directionIntegers = SobolRsg::JoeKuoD7,
const Handle< YieldTermStructure > &  discountCurve = Handle<YieldTermStructure>(),
const std::vector< Date > &  simulationDates = std::vector<Date>(),
const std::vector< Size > &  externalModelIndices = std::vector<Size>(),
const bool  minimalObsDate = true,
const RegressorModel  regressorModel = RegressorModel::Simple,
const Real  regressionVarianceCutoff = Null<Real>() 
)

Definition at line 41 of file mcmultilegoptionengine.cpp.

49 : McMultiLegOptionEngine(Handle<CrossAssetModel>(QuantLib::ext::make_shared<CrossAssetModel>(
50 std::vector<QuantLib::ext::shared_ptr<IrModel>>(1, model),
51 std::vector<QuantLib::ext::shared_ptr<FxBsParametrization>>())),
52 calibrationPathGenerator, pricingPathGenerator, calibrationSamples, pricingSamples,
53 calibrationSeed, pricingSeed, polynomOrder, polynomType, ordering, directionIntegers,
54 {discountCurve}, simulationDates, externalModelIndices, minimalObsDate, regressorModel,
55 regressionVarianceCutoff) {}
McMultiLegOptionEngine(const Handle< CrossAssetModel > &model, const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator, const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed, const Size pricingSeed, const Size polynomOrder, const LsmBasisSystem::PolynomialType polynomType, const SobolBrownianGenerator::Ordering ordering=SobolBrownianGenerator::Steps, const SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7, const std::vector< Handle< YieldTermStructure > > &discountCurves=std::vector< Handle< YieldTermStructure > >(), const std::vector< Date > &simulationDates=std::vector< Date >(), const std::vector< Size > &externalModelIndices=std::vector< Size >(), const bool minimalObsDate=true, const RegressorModel regressorModel=RegressorModel::Simple, const Real regressionVarianceCutoff=Null< Real >())

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 57 of file mcmultilegoptionengine.cpp.

57 {
58
59 leg_ = arguments_.legs;
60 currency_ = arguments_.currency;
61 payer_ = arguments_.payer;
62 exercise_ = arguments_.exercise;
63 optionSettlement_ = arguments_.settlementType;
64
66
67 // convert base ccy result from McMultiLegbaseEngine to desired npv currency
68 Real fxSpot = 1.0;
69 Size npvCcyIndex = model_->ccyIndex(currency_.front());
70 if (npvCcyIndex > 0)
71 fxSpot = model_->fxbs(npvCcyIndex - 1)->fxSpotToday()->value();
72 results_.value = resultValue_ / fxSpot;
73 results_.additionalResults["underlyingNpv"] = resultUnderlyingNpv_ / fxSpot;
74 results_.additionalResults["amcCalculator"] = amcCalculator();
75} // calculate
const Instrument::results * results_
Definition: cdsoption.cpp:81
QuantLib::ext::shared_ptr< Exercise > exercise_
QuantLib::ext::shared_ptr< AmcCalculator > amcCalculator() const
Swap::arguments * arguments_
+ Here is the call graph for this function:

◆ model()

const Handle< CrossAssetModel > & model ( ) const

Definition at line 67 of file mcmultilegoptionengine.hpp.

67{ return model_; }