xmin_estim: Estimate the minimum patch size of a power-law distribution

View source: R/fitpsd.R

xmin_estimR Documentation

Estimate the minimum patch size of a power-law distribution

Description

When fitting a power-law to a discrete distribution, it might be worth discarding points below a certain threshold (xmin) to improve the fit. This function estimates the optimal xmin based on the Kolmogorov-Smirnoff distance between the fit and the empirical distribution, as suggested by Clauset et al. (2009).

Usage

xmin_estim(dat, bounds = range(dat))

Arguments

dat

A vector of integer values

bounds

A vector of two values representing the bounds in which the best xmin is searched

Details

The function returns NA if dat has only three unique values or if the power-law fit failed.

Value

The estimated xmin as an integer value

References

Clauset, A., Shalizi, C. R., & Newman, M. E. (2009). Power-law distributions in empirical data. SIAM review, 51(4), 661-703.

See Also

patchdistr_sews

Examples


 
psd <- patchsizes(forestgap[[5]])
xmin_estim(psd)


spatialwarnings documentation built on Sept. 11, 2024, 8:55 p.m.