gblcc: Centred covariance based estimates of gliding box lacunarity

View source: R/gblcc.R

gblccR Documentation

Centred covariance based estimates of gliding box lacunarity


Estimates the gliding box lacunarity (GBL) of a stationary RACS using centred covariance estimates (Hingee et al., 2017). The centred covariance and coverage probability can be provided or estimated from binary map.


  cencovar = NULL,
  p = NULL,
  xiim = NULL,
  estimator = "pickaH",
  integrationMethod = "harmonisesum"

gblcc.inputcovar(boxes, cencovar, p, integrationMethod = "harmonisesum")



Either a list of side lengths for square boxes or a list of owin objects of any shape.


A im object containing the centred covariance function


The coverage probability. Typically estimated by the fraction of the observation window covered by the set of interest.


An observation of a stationary RACS as an im object. xiim must have values of either 1, 0 or NA; 1 denotes inside the RACS, 0 denotes outside, and NA denotes unobserved.


If an observation xiim is passed then estimator will select the balancing method that ccvc uses to estimate the centred covariance.


The integration method used by Default is 'harmonisesum' due centred covariance approaching zero for large vectors.


If we denote the estimated centred covariance by k(v) and coverage probability p then the estimate of GBL is

1 + \int gammaB(v) k(v) dv / (p^2 |B|^2),

where B is each of the sets (often called a box) specified by boxes, gammaB is the set covariance of B, |B| is the area of B, p is the coverage probability of a stationary RACS.

The set covariance of B is computed empirically using spatstat's setcov function, which converts B into a binary pixel mask using as.mask defaults. Computation speed can be increased by setting a small default number of pixels, npixel, in spatstat's global options (accessed through spatstat.options), however fewer pixels also decreases the accuracy of the GBL computation.


If boxes is a list of numerical values then GBL is estimated for square boxes with side length given by boxes. The returned object is then an fv object containing estimates of GBL, box mass variance and box mass mean.

If boxes is a list of owin objects then gblcc returns a dataframe of with columns corresponding to estimates of GBL, box mass variance and box mass mean. Note if NA or NaN values in the covariance object are used then gblc will return NA or NaN instead of an GBL value.


  • gblcc.inputcovar: GBL estimates from already estimated centred covariance.


Hingee K, Baddeley A, Caccetta P, Nair G (2019). Computation of lacunarity from covariance of spatial binary maps. Journal of Agricultural, Biological and Environmental Statistics, 24, 264-288. DOI: 10.1007/s13253-019-00351-9.


xi <- heather$coarse
cencovar <- cencovariance(xi, obswin = Frame(xi), estimators = c("pickaH"), drop = TRUE)
p <- area(xi) / area(Frame(xi))
sidelengths <- seq(0.3, 14, by = 1)

# reduce resolution in setcov() for faster (less accurate) computation 
oldopt <- spatstat.options()
spatstat.options("npixel" = 2^5)

# compute GBL estimate for square boxes from estimated centred covariance
gblccest <- gblcc(sidelengths, cencovar, p)

# compute GBL estimate for boxes that are discs
discboxes <- lapply(sidelengths / 2, disc)
discgbls <- gblcc(discboxes, cencovar, p)

# compute GBL estimates from binary map
xiim <-, na.replace = 0)
gblccest <- gblcc(sidelengths, xiim = xiim, estimator = "pickaH")


lacunaritycovariance documentation built on March 18, 2022, 5:20 p.m.