Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
lgmconvolutionsolver2.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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 lgmconvolutionsolver2.hpp
20 \brief numeric convolution solver for the LGM model using RandoMVariable
21
22 \ingroup engines
23*/
24
25#pragma once
26
29
30namespace QuantExt {
31
32//! Numerical convolution solver for the LGM model
33/*! Reference: Hagan, Methodology for callable swaps and Bermudan
34 exercise into swaptions
35*/
36
38public:
39 LgmConvolutionSolver2(const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model, const Real sy, const Size ny,
40 const Real sx, const Size nx);
41 Size gridSize() const override { return 2 * mx_ + 1; }
42 RandomVariable stateGrid(const Real t) const override;
43 // steps are always ignored, since we can take large steps
44 RandomVariable rollback(const RandomVariable& v, const Real t1, const Real t0,
45 Size steps = Null<Size>()) const override;
46 const QuantLib::ext::shared_ptr<LinearGaussMarkovModel>& model() const override { return model_; }
47
48private:
49 QuantLib::ext::shared_ptr<LinearGaussMarkovModel> model_;
50 int mx_, my_, nx_;
51 Real h_;
52 std::vector<Real> y_, w_;
53};
54
55} // namespace QuantExt
Interface for LGM1F backward solver.
Numerical convolution solver for the LGM model.
RandomVariable rollback(const RandomVariable &v, const Real t1, const Real t0, Size steps=Null< Size >()) const override
const QuantLib::ext::shared_ptr< LinearGaussMarkovModel > & model() const override
RandomVariable stateGrid(const Real t) const override
QuantLib::ext::shared_ptr< LinearGaussMarkovModel > model_
interface for LGM1F backward solver
JY INF index sigma component.
std::vector< Size > steps