Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
mclgmswaptionengine.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file mclgmswaptionengine.hpp
20 \brief MC LGM swaption engines
21 \ingroup engines
22*/
23
24#pragma once
25
27
28#include <ql/instruments/nonstandardswaption.hpp>
29#include <ql/instruments/swaption.hpp>
30
31namespace QuantExt {
32
33class McLgmSwaptionEngine : public GenericEngine<QuantLib::Swaption::arguments, QuantLib::Swaption::results>,
35public:
36 McLgmSwaptionEngine(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model,
37 const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator,
38 const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed,
39 const Size pricingSeed, const Size polynomOrder,
40 const LsmBasisSystem::PolynomialType polynomType,
41 const SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
42 const SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7,
43 const Handle<YieldTermStructure>& discountCurve = Handle<YieldTermStructure>(),
44 const std::vector<Date> simulationDates = std::vector<Date>(),
45 const std::vector<Size> externalModelIndices = std::vector<Size>(),
46 const bool minimalObsDate = true, const RegressorModel regressorModel = RegressorModel::Simple,
47 const Real regressionVarianceCutoff = Null<Real>())
48 : GenericEngine<QuantLib::Swaption::arguments, QuantLib::Swaption::results>(),
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 }
57
58 void calculate() const override;
59};
60
62 : public GenericEngine<QuantLib::NonstandardSwaption::arguments, QuantLib::NonstandardSwaption::results>,
64public:
65 McLgmNonstandardSwaptionEngine(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model,
66 const SequenceType calibrationPathGenerator, const SequenceType pricingPathGenerator,
67 const Size calibrationSamples, const Size pricingSamples, const Size calibrationSeed,
68 const Size pricingSeed, const Size polynomOrder,
69 const LsmBasisSystem::PolynomialType polynomType,
70 const SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
71 const SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7,
72 const Handle<YieldTermStructure>& discountCurve = Handle<YieldTermStructure>(),
73 const std::vector<Date> simulationDates = std::vector<Date>(),
74 const std::vector<Size> externalModelIndices = std::vector<Size>(),
75 const bool minimalObsDate = true,
76 const RegressorModel regressorModel = RegressorModel::Simple)
77 : GenericEngine<QuantLib::NonstandardSwaption::arguments, QuantLib::NonstandardSwaption::results>(),
79 std::vector<QuantLib::ext::shared_ptr<IrModel>>(1, model),
80 std::vector<QuantLib::ext::shared_ptr<FxBsParametrization>>())),
81 calibrationPathGenerator, pricingPathGenerator, calibrationSamples, pricingSamples,
82 calibrationSeed, pricingSeed, polynomOrder, polynomType, ordering, directionIntegers,
83 {discountCurve}, simulationDates, externalModelIndices, minimalObsDate, regressorModel) {
84 registerWith(model);
85 }
86
87 void calculate() const override;
88};
89
90} // namespace QuantExt
FX Black Scholes parametrizations.
McLgmNonstandardSwaptionEngine(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)
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 >())
base MC engine for multileg (option) instruments