plot_levy: Levy Flights Plotter

Description Usage Arguments Details Value Examples

View source: R/plotters.R

Description

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

Usage

1
plot_levy(chain, plot = TRUE)

Arguments

plot

Boolean. plot Boolean. Whether to return a plot or the elements used to make it.

Details

Values of μ \approx 2 have been used to describe foraging in animals, and produce the most effective foraging (Viswanathan et al., 1999). See Zhu et al. 2018 for a comparison of Levy Flight and PSD measures for different samplers in multimodal representations.

@param chain Matrix of n x d dimensions, n = iterations, d = dimensions

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 μ parameter. If false it returns a list with what's required to make the plot.

Examples

1
2
3
4
target <- distr::Norm()
pd_func <- make_distr_pdf(target)
chain1 <- sampler_mcmc(pd_func, 0, sigma_prop = 1)
plot_levy(chain1[[1]])

lucas-castillo/SampleR documentation built on Jan. 1, 2021, 8:25 a.m.