Coverage Report

Created: 2025-10-14 06:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/models/equity/batesmodel.cpp
Line
Count
Source
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
 <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/batesmodel.hpp>
21
#include <ql/shared_ptr.hpp>
22
23
namespace QuantLib {
24
25
    BatesModel::BatesModel(const ext::shared_ptr<BatesProcess> & process)
26
0
    : HestonModel(process) {
27
0
        arguments_.resize(8);
28
29
0
        arguments_[5] 
30
0
                = ConstantParameter(process->nu(),     NoConstraint());
31
0
        arguments_[6] 
32
0
                = ConstantParameter(process->delta(),  PositiveConstraint());
33
0
        arguments_[7] 
34
0
                = ConstantParameter(process->lambda(), PositiveConstraint());
35
        
36
0
        BatesModel::generateArguments();
37
0
    }
Unexecuted instantiation: QuantLib::BatesModel::BatesModel(boost::shared_ptr<QuantLib::BatesProcess> const&)
Unexecuted instantiation: QuantLib::BatesModel::BatesModel(boost::shared_ptr<QuantLib::BatesProcess> const&)
38
39
0
    void BatesModel::generateArguments() {
40
0
        process_ = ext::make_shared<BatesProcess>(
41
0
             process_->riskFreeRate(), process_->dividendYield(),
42
0
             process_->s0(), v0(), 
43
0
             kappa(), theta(), sigma(), rho(),
44
0
             lambda(), nu(), delta());
45
0
    }
46
47
    BatesDetJumpModel::BatesDetJumpModel(
48
            const ext::shared_ptr<BatesProcess> & process,
49
            Real kappaLambda, Real thetaLambda)
50
0
    : BatesModel(process) {
51
0
        arguments_.resize(10);
52
53
0
        arguments_[8] =
54
0
            ConstantParameter(kappaLambda, PositiveConstraint());
55
0
        arguments_[9] =
56
0
            ConstantParameter(thetaLambda, PositiveConstraint());
57
0
    }
Unexecuted instantiation: QuantLib::BatesDetJumpModel::BatesDetJumpModel(boost::shared_ptr<QuantLib::BatesProcess> const&, double, double)
Unexecuted instantiation: QuantLib::BatesDetJumpModel::BatesDetJumpModel(boost::shared_ptr<QuantLib::BatesProcess> const&, double, double)
58
59
60
    BatesDoubleExpModel::BatesDoubleExpModel(
61
        const ext::shared_ptr<HestonProcess> & process,
62
        Real lambda, Real nuUp, Real nuDown, Real p)
63
0
    : HestonModel(process) {
64
0
        arguments_.resize(9);
65
66
0
        arguments_[5] = ConstantParameter(p,
67
0
                                          BoundaryConstraint(0.0, 1.0));
68
0
        arguments_[6] = ConstantParameter(nuDown, PositiveConstraint());
69
0
        arguments_[7] = ConstantParameter(nuUp,   PositiveConstraint());
70
0
        arguments_[8] = ConstantParameter(lambda, PositiveConstraint());
71
0
    }
Unexecuted instantiation: QuantLib::BatesDoubleExpModel::BatesDoubleExpModel(boost::shared_ptr<QuantLib::HestonProcess> const&, double, double, double, double)
Unexecuted instantiation: QuantLib::BatesDoubleExpModel::BatesDoubleExpModel(boost::shared_ptr<QuantLib::HestonProcess> const&, double, double, double, double)
72
73
74
    BatesDoubleExpDetJumpModel::BatesDoubleExpDetJumpModel(
75
        const ext::shared_ptr<HestonProcess> & process,
76
        Real lambda, Real nuUp, Real nuDown,
77
        Real p, Real kappaLambda, Real thetaLambda)
78
0
    : BatesDoubleExpModel(process, lambda, nuUp, nuDown, p) {
79
0
        arguments_.resize(11);
80
81
0
        arguments_[9]  =
82
0
            ConstantParameter(kappaLambda, PositiveConstraint());
83
0
        arguments_[10] =
84
0
            ConstantParameter(thetaLambda, PositiveConstraint());
85
0
    }
Unexecuted instantiation: QuantLib::BatesDoubleExpDetJumpModel::BatesDoubleExpDetJumpModel(boost::shared_ptr<QuantLib::HestonProcess> const&, double, double, double, double, double, double)
Unexecuted instantiation: QuantLib::BatesDoubleExpDetJumpModel::BatesDoubleExpDetJumpModel(boost::shared_ptr<QuantLib::HestonProcess> const&, double, double, double, double, double, double)
86
}
87