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

#include <qle/pricingengines/mclgmswaptionengine.hpp>

+ Inheritance diagram for McLgmSwaptionEngine:
+ Collaboration diagram for McLgmSwaptionEngine:

Public Member Functions

 McLgmSwaptionEngine (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
 

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 33 of file mclgmswaptionengine.hpp.

Constructor & Destructor Documentation

◆ McLgmSwaptionEngine()

McLgmSwaptionEngine ( 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 36 of file mclgmswaptionengine.hpp.

48 : GenericEngine<QuantLib::Swaption::arguments, QuantLib::Swaption::results>(),
49 McMultiLegBaseEngine(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 registerWith(model);
56 }
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 >())

Member Function Documentation

◆ calculate()

void calculate ( ) const
override

Definition at line 25 of file mclgmswaptionengine.cpp.

25 {
26 leg_ = arguments_.legs;
27 currency_ = std::vector<Currency>(leg_.size(), model_->irlgm1f(0)->currency());
28 payer_.resize(arguments_.payer.size());
29 for (Size i = 0; i < arguments_.payer.size(); ++i) {
30 payer_[i] = QuantLib::close_enough(arguments_.payer[i], -1.0);
31 }
32 exercise_ = arguments_.exercise;
33 optionSettlement_ = arguments_.settlementType;
35 results_.value = resultValue_;
36 results_.additionalResults["underlyingNpv"] = resultUnderlyingNpv_;
37 results_.additionalResults["amcCalculator"] = amcCalculator();
38} // McLgmSwaptionEngine::calculate
const Instrument::results * results_
Definition: cdsoption.cpp:81
QuantLib::ext::shared_ptr< Exercise > exercise_
Handle< CrossAssetModel > model_
QuantLib::ext::shared_ptr< AmcCalculator > amcCalculator() const
Swap::arguments * arguments_
+ Here is the call graph for this function: