QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
gridmodellocalvolsurface.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) 2015 Klaus Spanderen
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 gridmodellocalvolsurface.hpp
21 \brief Parameterized volatility surface useful for model calibration
22*/
23
24#ifndef quantlib_grid_model_local_vol_surface_hpp
25#define quantlib_grid_model_local_vol_surface_hpp
26
27#include <ql/models/model.hpp>
29
30namespace QuantLib {
31
33 : public LocalVolTermStructure,
34 public CalibratedModel {
35 public:
37
39 const Date& referenceDate,
40 const std::vector<Date>& dates,
41 const std::vector<ext::shared_ptr<std::vector<Real> > >& strikes,
43 Extrapolation lowerExtrapolation
45 Extrapolation upperExtrapolation
47
48 void update() override;
49
50 Date maxDate() const override;
51 Time maxTime() const override;
52 Real minStrike() const override;
53 Real maxStrike() const override;
54
55 protected:
56 void generateArguments() override;
57 Volatility localVolImpl(Time t, Real strike) const override;
58
60 std::vector<Time> times_;
61 const std::vector<ext::shared_ptr<std::vector<Real> > > strikes_;
64
65 ext::shared_ptr<LocalVolTermStructure> localVol_;
66 };
67}
68
69#endif
Calibrated model class.
Definition: model.hpp:86
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
ext::shared_ptr< LocalVolTermStructure > localVol_
Real minStrike() const override
the minimum strike for which the term structure can return vols
Volatility localVolImpl(Time t, Real strike) const override
local vol calculation
const std::vector< ext::shared_ptr< std::vector< Real > > > strikes_
Date maxDate() const override
the latest date for which the curve can return values
FixedLocalVolSurface::Extrapolation Extrapolation
Real maxStrike() const override
the maximum strike for which the term structure can return vols
Time maxTime() const override
the latest time for which the curve can return values
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
const DefaultType & t
Local volatility surface based on fixed values plus interpolation.
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
Abstract interest rate model class.
Definition: any.hpp:35