QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
batesmodel.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) 2005 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
21#include <ql/shared_ptr.hpp>
22
23namespace QuantLib {
24
25 BatesModel::BatesModel(const ext::shared_ptr<BatesProcess> & process)
26 : HestonModel(process) {
27 arguments_.resize(8);
28
29 arguments_[5]
31 arguments_[6]
33 arguments_[7]
35
37 }
38
40 process_ = ext::make_shared<BatesProcess>(
41 process_->riskFreeRate(), process_->dividendYield(),
42 process_->s0(), v0(),
43 kappa(), theta(), sigma(), rho(),
44 lambda(), nu(), delta());
45 }
46
48 const ext::shared_ptr<BatesProcess> & process,
49 Real kappaLambda, Real thetaLambda)
50 : BatesModel(process) {
51 arguments_.resize(10);
52
53 arguments_[8] =
55 arguments_[9] =
57 }
58
59
61 const ext::shared_ptr<HestonProcess> & process,
62 Real lambda, Real nuUp, Real nuDown, Real p)
63 : HestonModel(process) {
64 arguments_.resize(9);
65
67 BoundaryConstraint(0.0, 1.0));
71 }
72
73
75 const ext::shared_ptr<HestonProcess> & process,
76 Real lambda, Real nuUp, Real nuDown,
77 Real p, Real kappaLambda, Real thetaLambda)
78 : BatesDoubleExpModel(process, lambda, nuUp, nuDown, p) {
79 arguments_.resize(11);
80
81 arguments_[9] =
83 arguments_[10] =
85 }
86}
87
extended versions of the Heston model
BatesDetJumpModel(const ext::shared_ptr< BatesProcess > &process, Real kappaLambda=1.0, Real thetaLambda=0.1)
Definition: batesmodel.cpp:47
BatesDoubleExpDetJumpModel(const ext::shared_ptr< HestonProcess > &process, Real lambda=0.1, Real nuUp=0.1, Real nuDown=0.1, Real p=0.5, Real kappaLambda=1.0, Real thetaLambda=0.1)
Definition: batesmodel.cpp:74
BatesDoubleExpModel(const ext::shared_ptr< HestonProcess > &process, Real lambda=0.1, Real nuUp=0.1, Real nuDown=0.1, Real p=0.5)
Definition: batesmodel.cpp:60
Bates stochastic-volatility model.
Definition: batesmodel.hpp:43
Real delta() const
Definition: batesmodel.hpp:48
Real lambda() const
Definition: batesmodel.hpp:49
BatesModel(const ext::shared_ptr< BatesProcess > &process)
Definition: batesmodel.cpp:25
void generateArguments() override
Definition: batesmodel.cpp:39
Constraint imposing all arguments to be in [low,high]
Definition: constraint.hpp:114
std::vector< Parameter > arguments_
Definition: model.hpp:126
Standard constant parameter .
Definition: parameter.hpp:71
Heston model for the stochastic volatility of an asset.
Definition: hestonmodel.hpp:42
ext::shared_ptr< HestonProcess > process_
Definition: hestonmodel.hpp:63
ext::shared_ptr< HestonProcess > process() const
Definition: hestonmodel.hpp:58
No constraint.
Definition: constraint.hpp:79
Constraint imposing positivity to all arguments
Definition: constraint.hpp:92
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:37
Maps shared_ptr to either the boost or std implementation.