/src/quantlib/ql/experimental/variancegamma/variancegammaprocess.hpp
Line | Count | Source (jump to first uncovered line) |
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 | | <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 | | /*! \file variancegammaprocess.hpp |
21 | | \brief Variance Gamma stochastic process |
22 | | */ |
23 | | |
24 | | #ifndef quantlib_variance_gamma_process_hpp |
25 | | #define quantlib_variance_gamma_process_hpp |
26 | | |
27 | | #include <ql/stochasticprocess.hpp> |
28 | | #include <ql/termstructures/yieldtermstructure.hpp> |
29 | | #include <ql/quote.hpp> |
30 | | |
31 | | namespace QuantLib { |
32 | | |
33 | | //! Variance gamma process |
34 | | |
35 | | /*! This class describes the stochastic volatility |
36 | | process. With a Brownian motion given by |
37 | | \f[ |
38 | | db = \theta dt + \sigma dW_t |
39 | | \f] |
40 | | then a Variance Gamma process X is defined by evaluating this |
41 | | Brownian motion at sample times driven by a Gamma process. If T is |
42 | | the value of a Gamma process with mean 1 and variance rate \f$ \nu |
43 | | \f$ then the Variance Gamma process is given by |
44 | | \f[ |
45 | | X(t) = B(T) |
46 | | \f] |
47 | | |
48 | | \ingroup processes |
49 | | */ |
50 | | class VarianceGammaProcess : public StochasticProcess1D { |
51 | | public: |
52 | | VarianceGammaProcess(Handle<Quote> s0, |
53 | | Handle<YieldTermStructure> dividendYield, |
54 | | Handle<YieldTermStructure> riskFreeRate, |
55 | | Real sigma, |
56 | | Real nu, |
57 | | Real theta); |
58 | | |
59 | | Real x0() const override; |
60 | | Real drift(Time t, Real x) const override; |
61 | | Real diffusion(Time t, Real x) const override; |
62 | | |
63 | 0 | Real sigma() const { return sigma_; } |
64 | 0 | Real nu() const { return nu_; } |
65 | 0 | Real theta() const { return theta_; } |
66 | | |
67 | | const Handle<Quote>& s0() const; |
68 | | const Handle<YieldTermStructure>& dividendYield() const; |
69 | | const Handle<YieldTermStructure>& riskFreeRate() const; |
70 | | |
71 | | private: |
72 | | Handle<Quote> s0_; |
73 | | Handle<YieldTermStructure> dividendYield_, riskFreeRate_; |
74 | | Real sigma_, nu_, theta_; |
75 | | }; |
76 | | |
77 | | } |
78 | | |
79 | | |
80 | | #endif |
81 | | |