QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Generalized Black-Scholes stochastic process. More...
#include <blackscholesprocess.hpp>
Public Member Functions | |
GeneralizedBlackScholesProcess (Handle< Quote > x0, Handle< YieldTermStructure > dividendTS, Handle< YieldTermStructure > riskFreeTS, Handle< BlackVolTermStructure > blackVolTS, const ext::shared_ptr< discretization > &d=ext::shared_ptr< discretization >(new EulerDiscretization), bool forceDiscretization=false) | |
GeneralizedBlackScholesProcess (Handle< Quote > x0, Handle< YieldTermStructure > dividendTS, Handle< YieldTermStructure > riskFreeTS, Handle< BlackVolTermStructure > blackVolTS, Handle< LocalVolTermStructure > localVolTS) | |
StochasticProcess1D interface | |
Real | x0 () const override |
returns the initial value of the state variable More... | |
Real | drift (Time t, Real x) const override |
Real | diffusion (Time t, Real x) const override |
Real | apply (Real x0, Real dx) const override |
Real | expectation (Time t0, Real x0, Time dt) const override |
Real | stdDeviation (Time t0, Real x0, Time dt) const override |
Real | variance (Time t0, Real x0, Time dt) const override |
Real | evolve (Time t0, Real x0, Time dt, Real dw) const override |
Time | time (const Date &) const override |
Observer interface | |
void | update () override |
Public Member Functions inherited from StochasticProcess1D | |
Public Member Functions inherited from StochasticProcess | |
~StochasticProcess () override=default | |
virtual Size | factors () const |
returns the number of independent factors of the process More... | |
void | update () override |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Inspectors | |
Handle< Quote > | x0_ |
Handle< YieldTermStructure > | riskFreeRate_ |
Handle< YieldTermStructure > | dividendYield_ |
Handle< BlackVolTermStructure > | blackVolatility_ |
Handle< LocalVolTermStructure > | externalLocalVolTS_ |
bool | forceDiscretization_ |
bool | hasExternalLocalVol_ |
RelinkableHandle< LocalVolTermStructure > | localVolatility_ |
bool | updated_ |
bool | isStrikeIndependent_ |
const Handle< Quote > & | stateVariable () const |
const Handle< YieldTermStructure > & | dividendYield () const |
const Handle< YieldTermStructure > & | riskFreeRate () const |
const Handle< BlackVolTermStructure > & | blackVolatility () const |
const Handle< LocalVolTermStructure > & | localVolatility () const |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Member Functions inherited from StochasticProcess1D | |
StochasticProcess1D ()=default | |
StochasticProcess1D (ext::shared_ptr< discretization >) | |
Protected Member Functions inherited from StochasticProcess | |
StochasticProcess ()=default | |
StochasticProcess (ext::shared_ptr< discretization >) | |
Protected Attributes inherited from StochasticProcess1D | |
ext::shared_ptr< discretization > | discretization_ |
Protected Attributes inherited from StochasticProcess | |
ext::shared_ptr< discretization > | discretization_ |
Generalized Black-Scholes stochastic process.
This class describes the stochastic process \( S \) governed by
\[ d\ln S(t) = (r(t) - q(t) - \frac{\sigma(t, S)^2}{2}) dt + \sigma dW_t. \]
Definition at line 54 of file blackscholesprocess.hpp.
GeneralizedBlackScholesProcess | ( | Handle< Quote > | x0, |
Handle< YieldTermStructure > | dividendTS, | ||
Handle< YieldTermStructure > | riskFreeTS, | ||
Handle< BlackVolTermStructure > | blackVolTS, | ||
const ext::shared_ptr< discretization > & | d = ext::shared_ptr<discretization>(new EulerDiscretization) , |
||
bool | forceDiscretization = false |
||
) |
GeneralizedBlackScholesProcess | ( | Handle< Quote > | x0, |
Handle< YieldTermStructure > | dividendTS, | ||
Handle< YieldTermStructure > | riskFreeTS, | ||
Handle< BlackVolTermStructure > | blackVolTS, | ||
Handle< LocalVolTermStructure > | localVolTS | ||
) |
|
overridevirtual |
returns the initial value of the state variable
Implements StochasticProcess1D.
Definition at line 70 of file blackscholesprocess.cpp.
Implements StochasticProcess1D.
Definition at line 74 of file blackscholesprocess.cpp.
Implements StochasticProcess1D.
Definition at line 84 of file blackscholesprocess.cpp.
applies a change to the asset value. By default, it returns \( x + \Delta x \).
Reimplemented from StochasticProcess1D.
Definition at line 88 of file blackscholesprocess.cpp.
Reimplemented from StochasticProcess1D.
Definition at line 92 of file blackscholesprocess.cpp.
returns the standard deviation \( S(x_{t_0 + \Delta t} | x_{t_0} = x_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess1D.
Definition at line 108 of file blackscholesprocess.cpp.
returns the variance \( V(x_{t_0 + \Delta t} | x_{t_0} = x_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess1D.
Definition at line 119 of file blackscholesprocess.cpp.
returns the asset value after a time interval \( \Delta t \) according to the given discretization. By default, it returns
\[ E(x_0,t_0,\Delta t) + S(x_0,t_0,\Delta t) \cdot \Delta w \]
where \( E \) is the expectation and \( S \) the standard deviation.
Reimplemented from StochasticProcess1D.
Definition at line 131 of file blackscholesprocess.cpp.
returns the time value corresponding to the given date in the reference system of the stochastic process.
Reimplemented from StochasticProcess.
Definition at line 149 of file blackscholesprocess.cpp.
|
overridevirtual |
This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.
Implements Observer.
Definition at line 154 of file blackscholesprocess.cpp.
Definition at line 160 of file blackscholesprocess.cpp.
const Handle< YieldTermStructure > & dividendYield | ( | ) | const |
const Handle< YieldTermStructure > & riskFreeRate | ( | ) | const |
const Handle< BlackVolTermStructure > & blackVolatility | ( | ) | const |
const Handle< LocalVolTermStructure > & localVolatility | ( | ) | const |
Definition at line 180 of file blackscholesprocess.cpp.
Definition at line 101 of file blackscholesprocess.hpp.
|
private |
Definition at line 102 of file blackscholesprocess.hpp.
|
private |
Definition at line 102 of file blackscholesprocess.hpp.
|
private |
Definition at line 103 of file blackscholesprocess.hpp.
|
private |
Definition at line 104 of file blackscholesprocess.hpp.
|
private |
Definition at line 105 of file blackscholesprocess.hpp.
|
private |
Definition at line 106 of file blackscholesprocess.hpp.
|
mutableprivate |
Definition at line 107 of file blackscholesprocess.hpp.
|
mutableprivate |
Definition at line 108 of file blackscholesprocess.hpp.
|
private |
Definition at line 108 of file blackscholesprocess.hpp.