QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
blackscholesprocess.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2001, 2002, 2003 Sadruddin Rejeb
5 Copyright (C) 2003 Ferdinando Ametrano
6 Copyright (C) 2004, 2005, 2006, 2007, 2009 StatPro Italia srl
7 Copyright (C) 2015 Peter Caspers
8
9 This file is part of QuantLib, a free-software/open-source library
10 for financial quantitative analysts and developers - http://quantlib.org/
11
12 QuantLib is free software: you can redistribute it and/or modify it
13 under the terms of the QuantLib license. You should have received a
14 copy of the license along with this program; if not, please email
15 <quantlib-dev@lists.sf.net>. The license is also available online at
16 <http://quantlib.org/license.shtml>.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the license for more details.
21*/
22
27#ifndef quantlib_black_scholes_process_hpp
28#define quantlib_black_scholes_process_hpp
29
30#include <ql/stochasticprocess.hpp>
31#include <ql/processes/eulerdiscretization.hpp>
32#include <ql/termstructures/yieldtermstructure.hpp>
33#include <ql/termstructures/volatility/equityfx/blackvoltermstructure.hpp>
34#include <ql/termstructures/volatility/equityfx/localvoltermstructure.hpp>
35#include <ql/quote.hpp>
36
37namespace QuantLib {
38
39 class LocalConstantVol;
40 class LocalVolCurve;
41
43
55 public:
60 const ext::shared_ptr<discretization>& d =
61 ext::shared_ptr<discretization>(new EulerDiscretization),
62 bool forceDiscretization = false);
63
69
71
72 Real x0() const override;
74 Real drift(Time t, Real x) const override;
76 Real diffusion(Time t, Real x) const override;
77 Real apply(Real x0, Real dx) const override;
82 Real expectation(Time t0, Real x0, Time dt) const override;
83 Real stdDeviation(Time t0, Real x0, Time dt) const override;
84 Real variance(Time t0, Real x0, Time dt) const override;
85 Real evolve(Time t0, Real x0, Time dt, Real dw) const override;
87 Time time(const Date&) const override;
89
90 void update() override;
92
94 const Handle<Quote>& stateVariable() const;
100 private:
109 };
110
112
124 public:
126 const Handle<Quote>& x0,
127 const Handle<YieldTermStructure>& riskFreeTS,
128 const Handle<BlackVolTermStructure>& blackVolTS,
129 const ext::shared_ptr<discretization>& d =
130 ext::shared_ptr<discretization>(new EulerDiscretization),
131 bool forceDiscretization = false);
132 };
133
135
145 public:
147 const Handle<Quote>& x0,
148 const Handle<YieldTermStructure>& dividendTS,
149 const Handle<YieldTermStructure>& riskFreeTS,
150 const Handle<BlackVolTermStructure>& blackVolTS,
151 const ext::shared_ptr<discretization>& d =
152 ext::shared_ptr<discretization>(new EulerDiscretization),
153 bool forceDiscretization = false);
154 };
155
157
169 public:
171 const Handle<Quote>& x0,
172 const Handle<YieldTermStructure>& riskFreeTS,
173 const Handle<BlackVolTermStructure>& blackVolTS,
174 const ext::shared_ptr<discretization>& d =
175 ext::shared_ptr<discretization>(new EulerDiscretization),
176 bool forceDiscretization = false);
177 };
178
180
193 public:
195 const Handle<Quote>& x0,
196 const Handle<YieldTermStructure>& foreignRiskFreeTS,
197 const Handle<YieldTermStructure>& domesticRiskFreeTS,
198 const Handle<BlackVolTermStructure>& blackVolTS,
199 const ext::shared_ptr<discretization>& d =
200 ext::shared_ptr<discretization>(new EulerDiscretization),
201 bool forceDiscretization = false);
202 };
203
204}
205
206
207#endif
Black (1976) stochastic process.
Merton (1973) extension to the Black-Scholes stochastic process.
Black-Scholes (1973) stochastic process.
Concrete date class.
Definition: date.hpp:125
Euler discretization for stochastic processes.
Garman-Kohlhagen (1983) stochastic process.
Generalized Black-Scholes stochastic process.
Real apply(Real x0, Real dx) const override
const Handle< Quote > & stateVariable() const
const Handle< LocalVolTermStructure > & localVolatility() const
RelinkableHandle< LocalVolTermStructure > localVolatility_
Handle< LocalVolTermStructure > externalLocalVolTS_
Handle< BlackVolTermStructure > blackVolatility_
const Handle< YieldTermStructure > & dividendYield() const
Time time(const Date &) const override
Real diffusion(Time t, Real x) const override
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
Real expectation(Time t0, Real x0, Time dt) const override
const Handle< BlackVolTermStructure > & blackVolatility() const
Real x0() const override
returns the initial value of the state variable
Real variance(Time t0, Real x0, Time dt) const override
const Handle< YieldTermStructure > & riskFreeRate() const
Shared handle to an observable.
Definition: handle.hpp:41
Relinkable handle to an observable.
Definition: handle.hpp:112
1-dimensional stochastic process
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