This function selects an appropriate value of global bandwidth
h0 for adaptive kernel estimation of the intensity function
for the point pattern X.
In adaptive estimation, each point in the point pattern is
subjected to a different amount of smoothing, controlled by
data-dependent or spatially-varying bandwidths.
The global bandwidth h0 is a scale factor
which is used to adjust all of the data-dependent bandwidths
according to the Abramson (1982) square-root rule.
This function considers each candidate value of bandwidth \(h\),
performs the smoothing steps described above, extracts the
adaptively-estimated intensity values
\(\hat\lambda(x_i)\) at each data point \(x_i\),
and calculates the Cronie-Van Lieshout criterion
$$
\mbox{CvL}(h) = \sum_{i=1}^n \frac 1 {\hat\lambda(x_i)}.
$$
The value of \(h\) which minimises the squared difference
$$
LP2(h) = (CvL(h) - |W|)^2
$$
(where |W| is the area of the window of X)
is selected as the optimal global bandwidth.
Bandwidths h are physical distance values
expressed in the same units as the coordinates of X.