bw.relrisk {spatstat.explore} | R Documentation |
Cross Validated Bandwidth Selection for Relative Risk Estimation
Description
Uses cross-validation to select a smoothing bandwidth for the estimation of relative risk.
Usage
bw.relrisk(X, ...)
## S3 method for class 'ppp'
bw.relrisk(X, method = "likelihood", ...,
nh = spatstat.options("n.bandwidth"),
hmin=NULL, hmax=NULL, warn=TRUE)
Arguments
X |
A multitype point pattern (object of class |
method |
Character string determining the cross-validation method.
Current options are |
nh |
Number of trial values of smoothing bandwith |
hmin , hmax |
Optional. Numeric values.
Range of trial values of smoothing bandwith |
warn |
Logical. If |
... |
Additional arguments passed to |
Details
This function selects an appropriate bandwidth for the nonparametric
estimation of relative risk using relrisk
.
Consider the indicators y_{ij}
which equal 1
when
data point x_i
belongs to type j
, and equal 0
otherwise.
For a particular value of smoothing bandwidth,
let \hat p_j(u)
be the estimated
probabilities that a point at location u
will belong to
type j
.
Then the bandwidth is chosen to minimise either the negative likelihood,
the squared error, or the approximately standardised squared error, of the
indicators y_{ij}
relative to the fitted
values \hat p_j(x_i)
. See Diggle (2003)
or Baddeley et al (2015).
The result is a numerical value giving the selected bandwidth sigma
.
The result also belongs to the class "bw.optim"
allowing it to be printed and plotted. The plot shows the cross-validation
criterion as a function of bandwidth.
The range of values for the smoothing bandwidth sigma
is set by the arguments hmin, hmax
. There is a sensible default,
based on multiples of Stoyan's rule of thumb bw.stoyan
.
If the optimal bandwidth is achieved at an endpoint of the
interval [hmin, hmax]
, the algorithm will issue a warning
(unless warn=FALSE
). If this occurs, then it is probably advisable
to expand the interval by changing the arguments hmin, hmax
.
Computation time depends on the number nh
of trial values
considered, and also on the range [hmin, hmax]
of values
considered, because larger values of sigma
require
calculations involving more pairs of data points.
Value
A single numerical value giving the selected bandwidth.
The result also belongs to the class "bw.optim"
(see bw.optim.object
)
which can be plotted to show the bandwidth selection criterion
as a function of sigma
.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au and Rolf Turner rolfturner@posteo.net.
References
Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press.
Diggle, P.J. (2003) Statistical analysis of spatial point patterns, Second edition. Arnold.
Kelsall, J.E. and Diggle, P.J. (1995) Kernel estimation of relative risk. Bernoulli 1, 3–16.
See Also
Examples
b <- bw.relrisk(urkiola)
b
plot(b)
b <- bw.relrisk(urkiola, hmax=20)
plot(b)