QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
gaussian1dnonstandardswaptionengine.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2013 Peter Caspers
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_pricers_gaussian1d_nonstandardswaption_hpp
25#define quantlib_pricers_gaussian1d_nonstandardswaption_hpp
26
27#include <ql/instruments/nonstandardswaption.hpp>
28#include <ql/models/shortrate/onefactormodels/gsr.hpp>
29#include <ql/pricingengines/genericmodelengine.hpp>
30#include <ql/termstructures/volatility/swaption/swaptionvolstructure.hpp>
31
32namespace QuantLib {
33
35
55 public GenericModelEngine<Gaussian1dModel,
56 NonstandardSwaption::arguments,
57 NonstandardSwaption::results> {
58 public:
63 };
64
66 const ext::shared_ptr<Gaussian1dModel> &model,
67 const int integrationPoints = 64, const Real stddevs = 7.0,
68 const bool extrapolatePayoff = true,
69 const bool flatPayoffExtrapolation = false,
70 const Handle<Quote> &oas = Handle<Quote>(), // continuously
71 // compounded w.r.t. yts
72 // daycounter
73 const Handle<YieldTermStructure> &discountCurve =
75 const Probabilities probabilities = None)
76 : BasketGeneratingEngine(model, oas, discountCurve),
80 integrationPoints_(integrationPoints), stddevs_(stddevs),
81 extrapolatePayoff_(extrapolatePayoff),
82 flatPayoffExtrapolation_(flatPayoffExtrapolation),
83 discountCurve_(discountCurve), oas_(oas),
84 probabilities_(probabilities) {
85
86 if (!oas_.empty())
88
89 if (!discountCurve_.empty())
91 }
92
94 const Handle<Gaussian1dModel> &model,
95 const int integrationPoints = 64, const Real stddevs = 7.0,
96 const bool extrapolatePayoff = true,
97 const bool flatPayoffExtrapolation = false,
98 const Handle<Quote> &oas = Handle<Quote>(), // continuously
99 // compounded w.r.t. yts
100 // daycounter
101 const Handle<YieldTermStructure> &discountCurve =
103 const Probabilities probabilities = None)
104 : BasketGeneratingEngine(model, oas, discountCurve),
108 integrationPoints_(integrationPoints), stddevs_(stddevs),
109 extrapolatePayoff_(extrapolatePayoff),
110 flatPayoffExtrapolation_(flatPayoffExtrapolation),
111 discountCurve_(discountCurve), oas_(oas),
112 probabilities_(probabilities) {
113
114 if (!oas_.empty())
116
117 if (!discountCurve_.empty())
119 }
120
121 void calculate() const override;
122
123 protected:
124 Real underlyingNpv(const Date& expiry, Real y) const override;
125 Swap::Type underlyingType() const override;
126 const Date underlyingLastDate() const override;
127 const Array initialGuess(const Date& expiry) const override;
128
129 private:
136 };
137}
138
139#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Concrete date class.
Definition: date.hpp:125
One factor model non standard swaption engine.
const Array initialGuess(const Date &expiry) const override
Gaussian1dNonstandardSwaptionEngine(const ext::shared_ptr< Gaussian1dModel > &model, const int integrationPoints=64, const Real stddevs=7.0, const bool extrapolatePayoff=true, const bool flatPayoffExtrapolation=false, const Handle< Quote > &oas=Handle< Quote >(), const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Probabilities probabilities=None)
Gaussian1dNonstandardSwaptionEngine(const Handle< Gaussian1dModel > &model, const int integrationPoints=64, const Real stddevs=7.0, const bool extrapolatePayoff=true, const bool flatPayoffExtrapolation=false, const Handle< Quote > &oas=Handle< Quote >(), const Handle< YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const Probabilities probabilities=None)
Real underlyingNpv(const Date &expiry, Real y) const override
Base class for some pricing engine on a particular model.
Shared handle to an observable.
Definition: handle.hpp:41
nonstandard swaption class
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35