Levy Flight distribution as needed by Boost Random. More...
#include <ql/experimental/math/levyflightdistribution.hpp>
Public Types | |
typedef Real | input_type |
typedef Real | result_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. | |
Inspectors | |
Real | xm () const |
Returns the xm parameter of the distribution. | |
Real | alpha () const |
Returns the alpha parameter of the distribution. | |
Real min | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the smallest value that the distribution can produce. | |
Real max | BOOST_PREVENT_MACRO_SUBSTITUTION () const |
Returns the largest value that the distribution can produce. | |
param_type | param () const |
Returns the parameters of the distribution. | |
void | param (const param_type &parm) |
Sets the parameters of the distribution. | |
void | reset () |
Real | operator() (Real x) const |
Returns the value of the pdf for x. | |
template<class Engine > | |
result_type | operator() (Engine &eng) const |
template<class Engine > | |
result_type | operator() (Engine &eng, const param_type &parm) const |
BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR (os, LevyFlightDistribution, ed) | |
Writes the distribution to a std::ostream. | |
BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR (is, LevyFlightDistribution, ed) | |
Reads the distribution from a std::istream. | |
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR (LevyFlightDistribution, lhs, rhs) | |
Levy Flight distribution as needed by Boost Random.
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.
|
explicit |
Constructs a LevyFlightDistribution with a given xm and alpha Requires: alpha > 0
void reset | ( | ) |
Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.
result_type operator() | ( | Engine & | eng | ) | const |
Returns a random variate distributed according to the levy flight distribution.
result_type operator() | ( | Engine & | eng, |
const param_type & | parm | ||
) | const |
Returns a random variate distributed according to the levy flight with parameters specified by parm
BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR | ( | LevyFlightDistribution | , |
lhs | , | ||
rhs | |||
) |
Returns true iff the two distributions will produce identical sequences of values given equal generators.