calc_levy: Levy Flights Calculator

View source: R/calc_functions.R

calc_levyR Documentation

Levy Flights Calculator

Description

This function analyses if the length of the jumps the sampler is making (l) belongs to a Levy probability density distribution, P(l) \approx l^{-\mu}.

Usage

calc_levy(chain, plot = FALSE)

Arguments

chain

Matrix of n x d dimensions, n = iterations, d = dimensions.

plot

Boolean. plot Boolean. Whether to also plot the distance-frequency relationship.

Details

Values of \mu \approx 2 have been used to describe foraging in animals, and produce the most effective foraging \insertCiteviswanathan1999OptimizingSuccessRandomsamplr. See \insertCitezhu2018MentalSamplingMultimodal;textualsamplr for a comparison of Levy Flight and PSD measures for different samplers in multimodal representations.

Value

If plot is true, it returns a simple plot with the log absolute difference in estimates and their frequency, as well as an estimate for the \mu parameter. If false it returns a list with what's required to make the plot.

References

\insertAllCited

Examples

set.seed(1)
chain1 <- sampler_mh(1, "norm", c(0,1), diag(1))
calc_levy(chain1[[1]], plot=TRUE)

samplr documentation built on April 4, 2025, 12:30 a.m.