QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Classes | List of all members
LevyFlightDistribution Class Reference

Levy Flight distribution. More...

#include <levyflightdistribution.hpp>

+ Collaboration diagram for LevyFlightDistribution:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LevyFlightDistribution() [1/2]

LevyFlightDistribution ( Real  xm = 1.0,
Real  alpha = 1.0 
)
explicit

Constructs a LevyFlightDistribution with a given xm and alpha Requires: alpha > 0

Definition at line 77 of file levyflightdistribution.hpp.

◆ LevyFlightDistribution() [2/2]

LevyFlightDistribution ( const param_type parm)
explicit

Constructs a LevyFlightDistribution from its parameters.

Definition at line 81 of file levyflightdistribution.hpp.

Member Function Documentation

◆ xm()

Real xm ( ) const

Returns the xm parameter of the distribution.

Definition at line 90 of file levyflightdistribution.hpp.

◆ alpha()

Real alpha ( ) const

Returns the alpha parameter of the distribution.

Definition at line 93 of file levyflightdistribution.hpp.

◆ BOOST_PREVENT_MACRO_SUBSTITUTION() [1/2]

Real min BOOST_PREVENT_MACRO_SUBSTITUTION ( ) const

Returns the smallest value that the distribution can produce.

Definition at line 96 of file levyflightdistribution.hpp.

◆ BOOST_PREVENT_MACRO_SUBSTITUTION() [2/2]

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() [1/2]

param_type param ( ) const

Returns the parameters of the distribution.

Definition at line 103 of file levyflightdistribution.hpp.

◆ param() [2/2]

void param ( const param_type parm)

Sets the parameters of the distribution.

Definition at line 107 of file levyflightdistribution.hpp.

+ Here is the call graph for this function:

◆ reset()

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.

◆ operator()() [1/3]

Real operator() ( Real  x) const

Returns the value of the pdf for x.

Definition at line 118 of file levyflightdistribution.hpp.

◆ operator()() [2/3]

Real operator() ( Engine &  eng) const

Returns a random variate distributed according to the levy flight distribution.

Definition at line 128 of file levyflightdistribution.hpp.

◆ operator()() [3/3]

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.

Member Data Documentation

◆ xm_

Real xm_
private

Definition at line 142 of file levyflightdistribution.hpp.

◆ alpha_

Real alpha_
private

Definition at line 143 of file levyflightdistribution.hpp.