QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
piecewisetimedependenthestonmodel.cpp
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 <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#include <ql/models/equity/piecewisetimedependenthestonmodel.hpp>
21#include <ql/quotes/simplequote.hpp>
22#include <utility>
23
24namespace QuantLib {
25
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 : CalibratedModel(5), s0_(s0), riskFreeRate_(riskFreeRate), dividendYield_(dividendYield),
37 timeGrid_(std::move(timeGrid)) {
38
39 arguments_[0] = theta;
40 arguments_[1] = kappa;
41 arguments_[2] = sigma;
42 arguments_[3] = rho;
44
48 }
49
51 return timeGrid_;
52 }
53
56 return dividendYield_;
57 }
58
61 return riskFreeRate_;
62 }
63}
64
Calibrated model class.
Definition: model.hpp:86
std::vector< Parameter > arguments_
Definition: model.hpp:126
Standard constant parameter .
Definition: parameter.hpp:71
Shared handle to an observable.
Definition: handle.hpp:41
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
Base class for model arguments.
Definition: parameter.hpp:38
PiecewiseTimeDependentHestonModel(const Handle< YieldTermStructure > &riskFreeRate, const Handle< YieldTermStructure > &dividendYield, const Handle< Quote > &s0, Real v0, const Parameter &theta, const Parameter &kappa, const Parameter &sigma, const Parameter &rho, TimeGrid timeGrid)
const Handle< YieldTermStructure > & dividendYield() const
const Handle< YieldTermStructure > & riskFreeRate() const
Constraint imposing positivity to all arguments
Definition: constraint.hpp:92
time grid class
Definition: timegrid.hpp:43
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
STL namespace.