Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
linearannuitymapping.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 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 linearannuitymapping.hpp
20 \brief linear annuity mapping function f(S) = a*S+b
21*/
22
23#pragma once
24
26
27namespace QuantExt {
28
29/*! linear annuity mapping function f(S) = a*S+b */
31public:
32 LinearAnnuityMapping(const Real a, const Real b);
33
34 Real map(const Real S) const override;
35 Real mapPrime(const Real S) const override;
36 Real mapPrime2(const Real S) const override;
37 bool mapPrime2IsZero() const override;
38
39 Real a() const { return a_; }
40 Real b() const { return b_; }
41
42private:
43 Real a_, b_;
44};
45
46/*! linear annuity mapping builder */
48public:
49 LinearAnnuityMappingBuilder(const Real a, const Real b);
50 LinearAnnuityMappingBuilder(const Handle<Quote>& reversion);
51 QuantLib::ext::shared_ptr<AnnuityMapping> build(const Date& valuationDate, const Date& optionDate, const Date& paymentDate,
52 const VanillaSwap& underlying,
53 const Handle<YieldTermStructure>& discountCurve) override;
54
55private:
56 Real a_ = Null<Real>(), b_ = Null<Real>();
57 Handle<Quote> reversion_;
58};
59
60} // namespace QuantExt
base class for annuity mapping functions used in TSR models
QuantLib::ext::shared_ptr< AnnuityMapping > build(const Date &valuationDate, const Date &optionDate, const Date &paymentDate, const VanillaSwap &underlying, const Handle< YieldTermStructure > &discountCurve) override
Real map(const Real S) const override
Real mapPrime(const Real S) const override
Real mapPrime2(const Real S) const override