/src/quantlib/ql/models/equity/piecewisetimedependenthestonmodel.cpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2010 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 | | <https://www.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 | | #include <ql/models/equity/piecewisetimedependenthestonmodel.hpp> |
21 | | #include <ql/quotes/simplequote.hpp> |
22 | | #include <utility> |
23 | | |
24 | | namespace QuantLib { |
25 | | |
26 | | PiecewiseTimeDependentHestonModel::PiecewiseTimeDependentHestonModel( |
27 | | const Handle<YieldTermStructure>& riskFreeRate, |
28 | | const Handle<YieldTermStructure>& dividendYield, |
29 | | const Handle<Quote>& s0, |
30 | | Real v0, |
31 | | const Parameter& theta, |
32 | | const Parameter& kappa, |
33 | | const Parameter& sigma, |
34 | | const Parameter& rho, |
35 | | TimeGrid timeGrid) |
36 | 0 | : CalibratedModel(5), s0_(s0), riskFreeRate_(riskFreeRate), dividendYield_(dividendYield), |
37 | 0 | timeGrid_(std::move(timeGrid)) { |
38 | |
|
39 | 0 | arguments_[0] = theta; |
40 | 0 | arguments_[1] = kappa; |
41 | 0 | arguments_[2] = sigma; |
42 | 0 | arguments_[3] = rho; |
43 | 0 | arguments_[4] = ConstantParameter(v0, PositiveConstraint()); |
44 | |
|
45 | 0 | registerWith(s0); |
46 | 0 | registerWith(riskFreeRate); |
47 | 0 | registerWith(dividendYield); |
48 | 0 | } Unexecuted instantiation: QuantLib::PiecewiseTimeDependentHestonModel::PiecewiseTimeDependentHestonModel(QuantLib::Handle<QuantLib::YieldTermStructure> const&, QuantLib::Handle<QuantLib::YieldTermStructure> const&, QuantLib::Handle<QuantLib::Quote> const&, double, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::TimeGrid) Unexecuted instantiation: QuantLib::PiecewiseTimeDependentHestonModel::PiecewiseTimeDependentHestonModel(QuantLib::Handle<QuantLib::YieldTermStructure> const&, QuantLib::Handle<QuantLib::YieldTermStructure> const&, QuantLib::Handle<QuantLib::Quote> const&, double, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::Parameter const&, QuantLib::TimeGrid) |
49 | | |
50 | 0 | const TimeGrid& PiecewiseTimeDependentHestonModel::timeGrid() const { |
51 | 0 | return timeGrid_; |
52 | 0 | } |
53 | | |
54 | | const Handle<YieldTermStructure>& |
55 | 0 | PiecewiseTimeDependentHestonModel::dividendYield() const { |
56 | 0 | return dividendYield_; |
57 | 0 | } |
58 | | |
59 | | const Handle<YieldTermStructure>& |
60 | 0 | PiecewiseTimeDependentHestonModel::riskFreeRate() const { |
61 | 0 | return riskFreeRate_; |
62 | 0 | } |
63 | | } |
64 | | |