# lohboot

##### Bootstrap Confidence Bands for Summary Function

Computes a bootstrap confidence band for a summary function of a point process.

- Keywords
- spatial, nonparametric

##### Usage

```
lohboot(X,
fun=c("pcf", "Kest", "Lest", "pcfinhom", "Kinhom", "Linhom"),
…, nsim=200, confidence=0.95, global=FALSE, type=7)
```

##### Arguments

- X
A point pattern (object of class

`"ppp"`

).- fun
Name of the summary function for which confidence intervals are desired: one of the strings

`"pcf"`

,`"Kest"`

,`"Lest"`

,`"pcfinhom"`

,`"Kinhom"`

or`"Linhom"`

. Alternatively, the function itself; it must be one of the functions listed here.- …
Arguments passed to the corresponding local version of the summary function (see Details).

- nsim
Number of bootstrap simulations.

- confidence
Confidence level, as a fraction between 0 and 1.

- global
Logical. If

`FALSE`

(the default), pointwise confidence intervals are constructed. If`TRUE`

, a global (simultaneous) confidence band is constructed.- type
Integer. Argument passed to

`quantile`

controlling the way the quantiles are calculated.

##### Details

This algorithm computes
confidence bands for the true value of the summary function
`fun`

using the bootstrap method of Loh (2008).

If `fun="pcf"`

, for example, the algorithm computes a pointwise
`(100 * confidence)`

% confidence interval for the true value of
the pair correlation function for the point process,
normally estimated by `pcf`

.
It starts by computing the array of
*local* pair correlation functions,
`localpcf`

, of the data pattern `X`

.
This array consists of the contributions to the estimate of the
pair correlation function from each
data point. Then these contributions are resampled `nsim`

times
with replacement; from each resampled dataset the total contribution
is computed, yielding `nsim`

random pair correlation functions.
The pointwise `alpha/2`

and `1 - alpha/2`

quantiles of
these functions are computed, where `alpha = 1 - confidence`

.
The average of the local functions is also computed as an estimate
of the pair correlation function.

To control the estimation algorithm, use the
arguments `…`

, which are passed to the local version
of the summary function, as shown below:

fun |
local version |

`pcf` |
`localpcf` |

`Kest` |
`localK` |

`Lest` |
`localK` |

`pcfinhom` |
`localpcfinhom` |

`Kinhom` |
`localKinhom` |

For `fun="Lest"`

, the calculations are first performed
as if `fun="Kest"`

, and then the square-root transformation is
applied to obtain the \(L\)-function.

Note that the confidence bands computed by
`lohboot(fun="pcf")`

may not contain the estimate of the
pair correlation function computed by `pcf`

,
because of differences between the algorithm parameters
(such as the choice of edge correction)
in `localpcf`

and `pcf`

.
If you are using `lohboot`

, the
appropriate point estimate of the pair correlation itself is
the pointwise mean of the local estimates, which is provided
in the result of `lohboot`

and is shown in the default plot.

If the confidence bands seem unbelievably narrow,
this may occur because the point pattern has a hard core
(the true pair correlation function is zero for certain values of
distance) or because of an optical illusion when the
function is steeply sloping (remember the width of the confidence
bands should be measured *vertically*).

An alternative to `lohboot`

is `varblock`

.

##### Value

A function value table
(object of class `"fv"`

)
containing columns giving the estimate of the summary function,
the upper and lower limits of the bootstrap confidence interval,
and the theoretical value of the summary function for a Poisson process.

##### References

Loh, J.M. (2008)
A valid and fast spatial bootstrap for correlation functions.
*The Astrophysical Journal*, **681**, 726--734.

##### See Also

Summary functions
`Kest`

,
`pcf`

,
`Kinhom`

,
`pcfinhom`

,
`localK`

,
`localpcf`

,
`localKinhom`

,
`localpcfinhom`

.

See `varblock`

for an alternative bootstrap technique.

##### Examples

```
# NOT RUN {
p <- lohboot(simdat, stoyan=0.5)
plot(p)
# }
```

*Documentation reproduced from package spatstat, version 1.52-1, License: GPL (>= 2)*