Coverage Report

Created: 2026-09-28 06:23

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/experimental/variancegamma/variancegammaprocess.cpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
Copyright (C) 2010 Adrian O' Neill
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/errors.hpp>
21
#include <ql/experimental/variancegamma/variancegammaprocess.hpp>
22
#include <ql/math/distributions/normaldistribution.hpp>
23
#include <ql/processes/eulerdiscretization.hpp>
24
#include <utility>
25
26
namespace QuantLib {
27
28
    VarianceGammaProcess::VarianceGammaProcess(Handle<Quote> s0,
29
                                               Handle<YieldTermStructure> dividendYield,
30
                                               Handle<YieldTermStructure> riskFreeRate,
31
                                               Real sigma,
32
                                               Real nu,
33
                                               Real theta)
34
0
    : StochasticProcess1D(ext::make_shared<EulerDiscretization>()),
35
0
      s0_(std::move(s0)), dividendYield_(std::move(dividendYield)),
36
0
      riskFreeRate_(std::move(riskFreeRate)), sigma_(sigma), nu_(nu), theta_(theta) {
37
0
        registerWith(riskFreeRate_);
38
0
        registerWith(dividendYield_);
39
0
        registerWith(s0_);
40
0
    }
41
42
    Real VarianceGammaProcess::x0() const
43
0
    {
44
0
        return s0_->value();
45
0
    }
46
47
    Real VarianceGammaProcess::drift(Time /*t*/, Real /*x*/) const
48
0
    {
49
0
        QL_FAIL("not implemented yet");
50
0
    }
51
52
    Real VarianceGammaProcess::diffusion(Time /*t*/, Real /*x*/) const
53
0
    {
54
0
        QL_FAIL("not implemented yet");
55
0
    }
56
57
0
    const Handle<Quote>& VarianceGammaProcess::s0() const {
58
0
        return s0_;
59
0
    }
60
61
0
    const Handle<YieldTermStructure>& VarianceGammaProcess::dividendYield() const {
62
0
        return dividendYield_;
63
0
    }
64
65
0
    const Handle<YieldTermStructure>& VarianceGammaProcess::riskFreeRate() const {
66
0
        return riskFreeRate_;
67
0
    }
68
69
}