Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bw.scott

Scott's Rule for Bandwidth Selection for Kernel Density


Description

Use Scott's rule of thumb to determine the smoothing bandwidth for the kernel estimation of point process intensity.

Usage

bw.scott(X, isotropic=FALSE, d=NULL)

   bw.scott.iso(X)

Arguments

X

A point pattern (object of class "ppp", "lpp", "pp3" or "ppx").

isotropic

Logical value indicating whether to compute a single bandwidth for an isotropic Gaussian kernel (isotropic=TRUE) or separate bandwidths for each coordinate axis (isotropic=FALSE, the default).

d

Advanced use only. An integer value that should be used in Scott's formula instead of the true number of spatial dimensions.

Details

These functions select a bandwidth sigma for the kernel estimator of point process intensity computed by density.ppp or other appropriate functions. They can be applied to a point pattern belonging to any class "ppp", "lpp", "pp3" or "ppx".

The bandwidth σ is computed by the rule of thumb of Scott (1992, page 152, equation 6.42). The bandwidth is proportional to n^(-1/(d+4)) where n is the number of points and d is the number of spatial dimensions.

This rule is very fast to compute. It typically produces a larger bandwidth than bw.diggle. It is useful for estimating gradual trend.

If isotropic=FALSE (the default), bw.scott provides a separate bandwidth for each coordinate axis, and the result of the function is a vector, of length equal to the number of coordinates. If isotropic=TRUE, a single bandwidth value is computed and the result is a single numeric value.

bw.scott.iso(X) is equivalent to bw.scott(X, isotropic=TRUE).

The default value of d is as follows:

class dimension
"ppp" 2
"lpp" 1
"pp3" 3
"ppx" number of spatial coordinates

The use of d=1 for point patterns on a linear network (class "lpp") was proposed by McSwiggan et al (2016) and Rakshit et al (2019).

Value

A numerical value giving the selected bandwidth, or a numerical vector giving the selected bandwidths for each coordinate.

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

References

Scott, D.W. (1992) Multivariate Density Estimation. Theory, Practice and Visualization. New York: Wiley.

See Also

Examples

hickory <- split(lansing)[["hickory"]]
  b <- bw.scott(hickory)
  b
  if(interactive()) {
   plot(density(hickory, b))
  }
  bw.scott.iso(hickory)
  bw.scott(osteo$pts[[1]])

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.