QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
gemanroncoroniprocess.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2011 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/*! \file gemanroncoroniprocess.hpp
21 \brief Geman-Roncoroni process
22*/
23
24#ifndef quantlib_geman_roncoroni_process_hpp
25#define quantlib_geman_roncoroni_process_hpp
26
29
30namespace QuantLib {
31
32 //! Geman-Roncoroni process class
33 /*! This class describes the Geman-Roncoroni process governed by
34 \f[
35 \begin{array}{rcl}
36 dE(t) &=& \left[ \frac{\partial}{\partial t} \mu(t)
37 +\theta_1 \left(\mu(t)-E(t^-)\right)\right]dt
38 +\sigma dW(t) + h(E(t^-))dJ(t) \\
39 \mu(t)&=& \alpha + \beta t +\gamma \cos(\epsilon+2\pi t)
40 +\delta \cos(\zeta + 4\pi t)
41 \end{array}
42 \f]
43
44 \ingroup processes
45 */
47 public:
50 Real gamma, Real delta,
51 Real eps, Real zeta, Real d,
52 Real k, Real tau,
53 Real sig2, Real a, Real b,
54 Real theta1, Real theta2, Real theta3,
55 Real psi);
56
57 Real x0() const override;
58 Real drift(Time t, Real x) const override;
59 Real diffusion(Time t, Real x) const override;
60 Real stdDeviation(Time t0, Real x0, Time dt) const override;
61 Real evolve(Time t0, Real x0, Time dt, Real dw) const override;
62
63 Real evolve(Time t0, Real x0, Time dt, Real dw, const Array& du) const;
64
65 private:
66 // avoid clang++ warnings
68
69 const Real x0_;
71 const Real eps_, zeta_, d_;
72 const Real k_, tau_;
73 const Real sig2_, a_, b_;
75 const Real psi_;
76 mutable ext::shared_ptr<PseudoRandom::urng_type> urng_;
77 };
78}
79
80
81#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Geman-Roncoroni process class.
Real diffusion(Time t, Real x) const override
returns the diffusion part of the equation, i.e.
ext::shared_ptr< PseudoRandom::urng_type > urng_
Real stdDeviation(Time t0, Real x0, Time dt) const override
Real evolve(Time t0, Real x0, Time dt, Real dw) const override
Real drift(Time t, Real x) const override
returns the drift part of the equation, i.e.
Real x0() const override
returns the initial value of the state variable
1-dimensional stochastic process
virtual Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const
const DefaultType & t
Date d
ext::function< Real(Real)> b
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
random-number generation policies
Real beta
Definition: sabr.cpp:200
Real alpha
Definition: sabr.cpp:200
stochastic processes