# bw.ppl

0th

Percentile

##### Likelihood Cross Validation Bandwidth Selection for Kernel Density

Uses likelihood cross-validation to select a smoothing bandwidth for the kernel estimation of point process intensity.

Keywords
methods, smooth, spatial
##### Usage
bw.ppl(X, …, srange=NULL, ns=16, sigma=NULL, weights=NULL,
shortcut=FALSE)
##### Arguments
X

A point pattern (object of class "ppp").

srange

Optional numeric vector of length 2 giving the range of values of bandwidth to be searched.

ns

Optional integer giving the number of values of bandwidth to search.

sigma

Optional. Vector of values of the bandwidth to be searched. Overrides the values of ns and srange.

weights

Optional. Numeric vector of weights for the points of X. Argument passed to density.ppp.

Additional arguments passed to density.ppp.

shortcut

Logical value indicating whether to speed up the calculation by omitting the integral term in the cross-validation criterion.

##### Details

This function selects an appropriate bandwidth sigma for the kernel estimator of point process intensity computed by density.ppp.

The bandwidth $\sigma$ is chosen to maximise the point process likelihood cross-validation criterion $$\mbox{LCV}(\sigma) = \sum_i \log\hat\lambda_{-i}(x_i) - \int_W \hat\lambda(u) \, {\rm d}u$$ where the sum is taken over all the data points $x_i$, where $\hat\lambda_{-i}(x_i)$ is the leave-one-out kernel-smoothing estimate of the intensity at $x_i$ with smoothing bandwidth $\sigma$, and $\hat\lambda(u)$ is the kernel-smoothing estimate of the intensity at a spatial location $u$ with smoothing bandwidth $\sigma$. See Loader(1999, Section 5.3).

The value of $\mbox{LCV}(\sigma)$ is computed directly, using density.ppp, for ns different values of $\sigma$ between srange and srange.

The result is a numerical value giving the selected bandwidth. The result also belongs to the class "bw.optim" which can be plotted to show the (rescaled) mean-square error as a function of sigma.

If shortcut=TRUE, the computation is accelerated by omitting the integral term in the equation above. This is valid because the integral is approximately constant.

##### Value

A numerical value giving the selected bandwidth. The result also belongs to the class "bw.optim" which can be plotted.

##### References

Loader, C. (1999) Local Regression and Likelihood. Springer, New York.

density.ppp, bw.diggle, bw.scott, bw.CvL, bw.frac.

For point patterns on a linear network, use bw.lppl.

• bw.ppl
##### Examples
# NOT RUN {
if(interactive()) {
b <- bw.ppl(redwood)
plot(b, main="Likelihood cross validation for redwoods")
plot(density(redwood, b))
}

# }

Documentation reproduced from package spatstat, version 1.61-0, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.
{"ft_lang_label":"__label__en","ft_lang_prob":0.66547596,"math_prob":0.9876351,"size":2590,"snap":"2019-51-2020-05","text_gpt3_token_len":651,"char_repetition_ratio":0.12103635,"word_repetition_ratio":0.1005291,"special_character_ratio":0.24169885,"punctuation_ratio":0.13800424,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9986939,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-01-20T03:04:11Z\",\"WARC-Record-ID\":\"<urn:uuid:898de956-8cea-48a3-a656-9c10ebad04bf>\",\"Content-Length\":\"18046\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1041cc9b-00c1-471f-bf23-fa48a3c47da3>\",\"WARC-Concurrent-To\":\"<urn:uuid:729e1231-2be4-49a0-a703-5f0d6fe7dc92>\",\"WARC-IP-Address\":\"54.80.66.241\",\"WARC-Target-URI\":\"https://www.rdocumentation.org/packages/spatstat/versions/1.61-0/topics/bw.ppl\",\"WARC-Payload-Digest\":\"sha1:L23QIGD6YG6HJQ3FGRVM4VQ65GA7TBUZ\",\"WARC-Block-Digest\":\"sha1:IH5LQQSXRK6XEGEREHHGKKQOM2K4WSOX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-05/CC-MAIN-2020-05_segments_1579250597230.18_warc_CC-MAIN-20200120023523-20200120051523-00475.warc.gz\"}"}