QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
batesmodel.cpp
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
20#include <ql/models/equity/batesmodel.hpp>
21
22namespace QuantLib {
23
24 BatesModel::BatesModel(const ext::shared_ptr<BatesProcess> & process)
25 : HestonModel(process) {
26 arguments_.resize(8);
27
28 arguments_[5]
30 arguments_[6]
32 arguments_[7]
34
36 }
37
39 process_.reset(new BatesProcess(
40 process_->riskFreeRate(), process_->dividendYield(),
41 process_->s0(), v0(),
42 kappa(), theta(), sigma(), rho(),
43 lambda(), nu(), delta()));
44 }
45
47 const ext::shared_ptr<BatesProcess> & process,
48 Real kappaLambda, Real thetaLambda)
49 : BatesModel(process) {
50 arguments_.resize(10);
51
52 arguments_[8] =
54 arguments_[9] =
56 }
57
58
60 const ext::shared_ptr<HestonProcess> & process,
61 Real lambda, Real nuUp, Real nuDown, Real p)
62 : HestonModel(process) {
63 arguments_.resize(9);
64
66 BoundaryConstraint(0.0, 1.0));
70 }
71
72
74 const ext::shared_ptr<HestonProcess> & process,
75 Real lambda, Real nuUp, Real nuDown,
76 Real p, Real kappaLambda, Real thetaLambda)
77 : BatesDoubleExpModel(process, lambda, nuUp, nuDown, p) {
78 arguments_.resize(11);
79
80 arguments_[9] =
82 arguments_[10] =
84 }
85}
86
BatesDetJumpModel(const ext::shared_ptr< BatesProcess > &process, Real kappaLambda=1.0, Real thetaLambda=0.1)
Definition: batesmodel.cpp:46
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:73
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:59
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:24
void generateArguments() override
Definition: batesmodel.cpp:38
Square-root stochastic-volatility Bates process.
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:35