QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Levy Flight distribution. More...
#include <levyflightdistribution.hpp>
Classes | |
class | param_type |
Public Member Functions | |
Constructors | |
LevyFlightDistribution (Real xm=1.0, Real alpha=1.0) | |
LevyFlightDistribution (const param_type &parm) | |
Constructs a LevyFlightDistribution from its parameters. More... | |
Inspectors | |
Real | xm_ |
Real | alpha_ |
Real | xm () const |
Returns the xm parameter of the distribution. More... | |
Real | alpha () const |
Returns the alpha parameter of the distribution. More... | |
Real min | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the smallest value that the distribution can produce. More... | |
Real max | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the largest value that the distribution can produce. More... | |
param_type | param () const |
Returns the parameters of the distribution. More... | |
void | param (const param_type &parm) |
Sets the parameters of the distribution. More... | |
void | reset () |
Real | operator() (Real x) const |
Returns the value of the pdf for x. More... | |
template<class Engine > | |
Real | operator() (Engine &eng) const |
template<class Engine > | |
Real | operator() (Engine &eng, const param_type &parm) const |
Levy Flight distribution.
The levy flight distribution is a random distribution with the following form:
\[ p(x) = \frac{\alpha x_m^{\alpha}}{x^{\alpha+1}} \]
with support over \( x \in [x_m, \infty) \) and the parameter \( \alpha > 0 \).
Levy Flight is normally defined as \( x_m = 1 \) and \( 0 < \alpha < 2 \), which is where \( p(x) \) has an infinite variance. However, the more general version, known as Pareto Type I, is well defined for \( \alpha > 2 \), so the current implementation does not restrict \( \alpha \) to be smaller than 2.
Definition at line 49 of file levyflightdistribution.hpp.
|
explicit |
Constructs a LevyFlightDistribution with a given xm and alpha Requires: alpha > 0
Definition at line 77 of file levyflightdistribution.hpp.
|
explicit |
Constructs a LevyFlightDistribution from its parameters.
Definition at line 81 of file levyflightdistribution.hpp.
Real xm | ( | ) | const |
Returns the xm parameter of the distribution.
Definition at line 90 of file levyflightdistribution.hpp.
Real alpha | ( | ) | const |
Returns the alpha parameter of the distribution.
Definition at line 93 of file levyflightdistribution.hpp.
Real min BOOST_PREVENT_MACRO_SUBSTITUTION | ( | ) | const |
Returns the smallest value that the distribution can produce.
Definition at line 96 of file levyflightdistribution.hpp.
Real max BOOST_PREVENT_MACRO_SUBSTITUTION | ( | ) | const |
Returns the largest value that the distribution can produce.
Definition at line 99 of file levyflightdistribution.hpp.
param_type param | ( | ) | const |
Returns the parameters of the distribution.
Definition at line 103 of file levyflightdistribution.hpp.
void param | ( | const param_type & | parm | ) |
Sets the parameters of the distribution.
Definition at line 107 of file levyflightdistribution.hpp.
void reset | ( | ) |
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
Definition at line 115 of file levyflightdistribution.hpp.
Returns the value of the pdf for x.
Definition at line 118 of file levyflightdistribution.hpp.
Real operator() | ( | Engine & | eng | ) | const |
Returns a random variate distributed according to the levy flight distribution.
Definition at line 128 of file levyflightdistribution.hpp.
Real operator() | ( | Engine & | eng, |
const param_type & | parm | ||
) | const |
Returns a random variate distributed according to the levy flight with parameters specified by parm
Definition at line 137 of file levyflightdistribution.hpp.
|
private |
Definition at line 142 of file levyflightdistribution.hpp.
|
private |
Definition at line 143 of file levyflightdistribution.hpp.