QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
andreasenhugelocalvoladapter.cpp
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) 2017, 2018 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
23#include <utility>
24
25namespace QuantLib {
26
27
29 ext::shared_ptr<AndreasenHugeVolatilityInterpl> localVol)
30 : localVol_(std::move(localVol)) {}
31
33 return localVol_->maxDate();
34 }
35
37 return 0.0;
38 }
39
41 return QL_MAX_REAL;
42 }
43
46 return localVol_->localVol(t,
47 std::min(localVol_->maxStrike(),
48 std::max(localVol_->minStrike(), strike)));
49 }
50
52 return localVol_->riskFreeRate()->calendar();
53 }
55 return localVol_->riskFreeRate()->dayCounter();
56 }
58 return localVol_->riskFreeRate()->referenceDate();
59 }
61 return localVol_->riskFreeRate()->settlementDays();
62 }
63}
Implements the LocalVolTermStructure interface based on a Andreasen-Huge volatility interpolation.
Andreasen-Huge local volatility calibration and interpolation.
Calendar calendar() const override
the calendar used for reference and/or option date calculation
const ext::shared_ptr< AndreasenHugeVolatilityInterpl > localVol_
const Date & referenceDate() const override
the date at which discount = 1.0 and/or variance = 0.0
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
Natural settlementDays() const override
the settlementDays used for reference date calculation
DayCounter dayCounter() const override
the day counter used for date/time conversion
Date maxDate() const override
the latest date for which the curve can return values
AndreasenHugeLocalVolAdapter(ext::shared_ptr< AndreasenHugeVolatilityInterpl > localVol)
Real maxStrike() const override
the maximum strike for which the term structure can return vols
calendar class
Definition: calendar.hpp:61
Concrete date class.
Definition: date.hpp:125
day counter class
Definition: daycounter.hpp:44
const DefaultType & t
#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
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
Real Volatility
volatility
Definition: types.hpp:78
Definition: any.hpp:35
STL namespace.
Interest-rate term structure.