QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
svismilesection.hpp
Go to the documentation of this file.
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
20/*! \file svismilesection.hpp
21 \brief svi smile section
22*/
23
24#ifndef quantlib_svi_smile_section_hpp
25#define quantlib_svi_smile_section_hpp
26
29#include <vector>
30
31namespace QuantLib {
32
33//! Stochastic Volatility Inspired Smile Section
34/*! \test the correctness of the result is tested by checking it
35 against known good values.
36*/
38
39 public:
40 //! \name Constructors
41 //@{
42 /*! @param timeToExpiry Time to expiry
43 @param forward Forward price corresponding to the expiry date
44 @param sviParameters Expects SVI parameters as a vector composed of a, b, sigma, rho, m
45 */
46 SviSmileSection(Time timeToExpiry, Rate forward, std::vector<Real> sviParameters);
47 /*! @param d Date of expiry
48 @param forward Forward price corresponding to the expiry date
49 @param sviParameters Expects SVI parameters as a vector composed of a, b, sigma, rho, m
50 @param dc Day count method used to compute the time to expiry
51 */
52 SviSmileSection(const Date& d,
53 Rate forward,
54 std::vector<Real> sviParameters,
55 const DayCounter& dc = Actual365Fixed());
56 //@}
57 Real minStrike() const override { return 0.0; }
58 Real maxStrike() const override { return QL_MAX_REAL; }
59 Real atmLevel() const override { return forward_; }
60
61 protected:
62 Volatility volatilityImpl(Rate strike) const override;
63
64 private:
65 void init();
67 std::vector<Real> params_;
68};
69}
70
71#endif
Actual/365 (Fixed) day counter.
Actual/365 (Fixed) day count convention.
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
interest rate volatility smile section
Stochastic Volatility Inspired Smile Section.
Real atmLevel() const override
Real minStrike() const override
std::vector< Real > params_
Volatility volatilityImpl(Rate strike) const override
Real maxStrike() const override
Date d
#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
Smile section base class.