QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
zabr.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 zabr.hpp
21 \brief ZABR functions
22 Reference: Andreasen, Huge: ZABR - Expansions for the masses, Preliminary
23 Version, December 2011, http://ssrn.com/abstract=1980726
24*/
25
26#ifndef quantlib_zabr_hpp
27#define quantlib_zabr_hpp
28
29#include <ql/types.hpp>
34#include <vector>
35
36namespace QuantLib {
37
38class ZabrModel {
39
40 public:
42
44 std::vector<Real> localVolatility(const std::vector<Real> &f) const;
45
46 Real fdPrice(Real strike) const;
47 std::vector<Real> fdPrice(const std::vector<Real> &strikes) const;
48
49 Real fullFdPrice(Real strike) const;
50
51 Real lognormalVolatility(Real strike) const;
52 std::vector<Real> lognormalVolatility(const std::vector<Real> &strikes) const;
53
54 Real normalVolatility(Real strike) const;
55 std::vector<Real> normalVolatility(const std::vector<Real> &strikes) const;
56
57 Real forward() const { return forward_; }
58 Real expiryTime() const { return expiryTime_; }
59 Real alpha() const { return alpha_; }
60 Real beta() const { return beta_; }
61 Real nu() const { return nu_; }
62 Real rho() const { return rho_; }
63 Real gamma() const { return gamma_; }
64
65 private:
68 gamma_; // nu_ here is a tranformed version of the input nu !
69
70 Real x(Real strike) const;
71 std::vector<Real> x(const std::vector<Real> &strikes) const;
72
73 Real y(Real strike) const;
74
75 Real F(Real y, Real u) const;
76
78 Real normalVolatilityHelper(Real strike, Real x) const;
80};
81}
82
83#endif
bicubic spline interpolation between discrete points
Real x(Real strike) const
Definition: zabr.cpp:311
const Real beta_
Definition: zabr.hpp:67
Real normalVolatility(Real strike) const
Definition: zabr.cpp:84
const Real rho_
Definition: zabr.hpp:67
Real lognormalVolatility(Real strike) const
Definition: zabr.cpp:65
const Real alpha_
Definition: zabr.hpp:67
Real localVolatility(Real f) const
Definition: zabr.cpp:103
Real forward() const
Definition: zabr.hpp:57
Real fdPrice(Real strike) const
Definition: zabr.cpp:115
const Real gamma_
Definition: zabr.hpp:68
Real expiryTime() const
Definition: zabr.hpp:58
Real fullFdPrice(Real strike) const
Definition: zabr.cpp:199
Real localVolatilityHelper(Real f, Real x) const
Definition: zabr.cpp:96
Real rho() const
Definition: zabr.hpp:62
Real nu() const
Definition: zabr.hpp:61
Real lognormalVolatilityHelper(Real strike, Real x) const
Definition: zabr.cpp:57
const Real expiryTime_
Definition: zabr.hpp:66
const Real nu_
Definition: zabr.hpp:67
Real gamma() const
Definition: zabr.hpp:63
Real normalVolatilityHelper(Real strike, Real x) const
Definition: zabr.cpp:77
Real beta() const
Definition: zabr.hpp:60
Real alpha() const
Definition: zabr.hpp:59
const Real forward_
Definition: zabr.hpp:66
cubic interpolation between discrete points
QL_REAL Real
real number
Definition: types.hpp:50
statistics tool based on incremental accumulation in the meantime, this is just a wrapper to the boos...
linear interpolation between discrete points
Definition: any.hpp:35
Real F
Definition: sabr.cpp:200
Custom types.