QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
variancegammaprocess.cpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4Copyright (C) 2010 Adrian O' Neill
5
6This file is part of QuantLib, a free-software/open-source library
7for financial quantitative analysts and developers - http://quantlib.org/
8
9QuantLib is free software: you can redistribute it and/or modify it
10under the terms of the QuantLib license. You should have received a
11copy 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
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR 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
26namespace QuantLib {
27
29 Handle<YieldTermStructure> dividendYield,
30 Handle<YieldTermStructure> riskFreeRate,
31 Real sigma,
32 Real nu,
33 Real theta)
35 s0_(std::move(s0)), dividendYield_(std::move(dividendYield)),
36 riskFreeRate_(std::move(riskFreeRate)), sigma_(sigma), nu_(nu), theta_(theta) {
40 }
41
43 {
44 return s0_->value();
45 }
46
48 {
49 QL_FAIL("not implemented yet");
50 }
51
53 {
54 QL_FAIL("not implemented yet");
55 }
56
58 return s0_;
59 }
60
62 return dividendYield_;
63 }
64
66 return riskFreeRate_;
67 }
68
69}
Euler discretization for stochastic processes.
Shared handle to an observable.
Definition: handle.hpp:41
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Definition: observable.hpp:228
1-dimensional stochastic process
discretization of a stochastic process over a given time interval
const Handle< YieldTermStructure > & dividendYield() const
Real diffusion(Time t, Real x) const override
returns the diffusion part of the equation, i.e.
VarianceGammaProcess(Handle< Quote > s0, Handle< YieldTermStructure > dividendYield, Handle< YieldTermStructure > riskFreeRate, Real sigma, Real nu, Real theta)
Real drift(Time t, Real x) const override
returns the drift part of the equation, i.e.
Handle< YieldTermStructure > dividendYield_
Real x0() const override
returns the initial value of the state variable
const Handle< Quote > & s0() const
const Handle< YieldTermStructure > & riskFreeRate() const
Handle< YieldTermStructure > riskFreeRate_
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
STL namespace.