QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
noarbsabrsmilesection.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2014 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_noarbsabr_smile_section_hpp
25#define quantlib_noarbsabr_smile_section_hpp
26
27#include <ql/termstructures/volatility/smilesection.hpp>
28#include <ql/time/daycounters/actual365fixed.hpp>
29#include <ql/experimental/volatility/noarbsabr.hpp>
30#include <vector>
31
32namespace QuantLib {
33
35
36 public:
37 NoArbSabrSmileSection(Time timeToExpiry,
38 Rate forward,
39 std::vector<Real> sabrParameters,
40 Real shift = 0.0,
43 Rate forward,
44 std::vector<Real> sabrParameters,
45 const DayCounter& dc = Actual365Fixed(),
46 Real shift = 0.0,
48 Real minStrike() const override { return 0.0; }
49 Real maxStrike() const override { return QL_MAX_REAL; }
50 Real atmLevel() const override { return forward_; }
51 Real
52 optionPrice(Rate strike, Option::Type type = Option::Call, Real discount = 1.0) const override;
55 Real discount = 1.0,
56 Real gap = 1.0e-5) const override;
57 Real density(Rate strike, Real discount = 1.0, Real gap = 1.0E-4) const override;
58
59 ext::shared_ptr<NoArbSabrModel> model() { return model_; }
60
61 protected:
62 Volatility volatilityImpl(Rate strike) const override;
63
64 private:
65 void init();
66 ext::shared_ptr<NoArbSabrModel> model_;
68 std::vector<Real> params_;
70};
71}
72
73#endif
Actual/365 (Fixed) day count convention.
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
Real density(Rate strike, Real discount=1.0, Real gap=1.0E-4) const override
ext::shared_ptr< NoArbSabrModel > model_
Real digitalOptionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0, Real gap=1.0e-5) const override
ext::shared_ptr< NoArbSabrModel > model()
Real optionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0) const override
Volatility volatilityImpl(Rate strike) const override
interest rate volatility smile section
virtual VolatilityType volatilityType() const
virtual Rate shift() const
#define QL_MAX_REAL
Definition: qldefines.hpp:176
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Real Rate
interest rates
Definition: types.hpp:70
Definition: any.hpp:35