bw.relrisk(X, method = "likelihood", nh = spatstat.options("n.bandwidth"),
hmin=NULL, hmax=NULL, warn=TRUE)"ppp"
which has factor valued marks)."likelihood",
"leastsquares" or
"weightedleastsquares".sigma
to consider. The default is 32.sigma
to consider. There is a sensible default.TRUE, issue a warning if the minimum of
the cross-validation criterion occurs at one of the ends of the
search interval."bw.optim"
which can be plotted.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 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). 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.
relrisk,
bw.stoyandata(urkiola)
<testonly>op <- spatstat.options(n.bandwidth=8)</testonly>
b <- bw.relrisk(urkiola)
b
plot(b)
b <- bw.relrisk(urkiola, hmax=20)
plot(b)
<testonly>spatstat.options(op)</testonly>Run the code above in your browser using DataLab