# 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"),
…,
block=FALSE, global=FALSE, basicboot=FALSE, Vcorrection=FALSE,
confidence=0.95, nx = 4, ny = nx, nsim=200, 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).

- block
Logical value indicating whether to use Loh's block bootstrap as originally proposed. Default is

`FALSE`

for consistency with older code. See Details.- global
Logical. If

`FALSE`

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

, a global (simultaneous) confidence band is constructed.- basicboot
Logical value indicating whether to use the so-called basic bootstrap confidence interval. See Details.

- Vcorrection
Logical value indicating whether to use a variance correction when

`fun="Kest"`

or`fun="Kinhom"`

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

- nx,ny
Integers. If

`block=TRUE`

, divide the window into`nx*ny`

rectangles.- nsim
Number of bootstrap simulations.

- type
Integer. Type of quantiles. Argument passed to

`quantile.default`

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)
and a modification described in Baddeley, Rubak, Turner (2015).

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.

If `block=FALSE`

, these contributions are resampled `nsim`

times
with replacement as described in Baddeley, Rubak, Turner (2015);
from each resampled dataset the total contribution
is computed, yielding `nsim`

random pair correlation functions.

If `block=TRUE`

, the calculation is performed as originally
proposed by Loh (2008, 2010). The (bounding box of the) window is divided
into \(nx * ny\) rectangles (blocks).
The average contribution of a block
is obtained by averaging the contribution of each point included in the block.
Then, the average contributions on each block are resampled `nsim`

times
with replacement as described in Loh (2008) and Loh (2010);
from each resampled dataset the total contribution
is computed, yielding `nsim`

random pair correlation functions.
Notice that for non-rectangular windows any blocks not fully contained in the
window are discarded before doing the resampling, so the effective number of
blocks may be substantially smaller than \(nx * ny\) in this case.

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.

There are several ways to define a bootstrap confidence interval.
If `basicbootstrap=TRUE`

,
the so-called basic confidence bootstrap interval
is used as described in Loh (2008).

It has been noticed in Loh (2010) that
when the intensity of the point process is unknown,
the bootstrap error estimate is larger than it should be.
When the \(K\) function is used,
an adjustment procedure has been proposed in Loh (2010)
that is used if `Vcorrection=TRUE`

.
In this case, the basic confidence bootstrap interval is implicitly used.

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

Baddeley, A., Rubak, E. and Turner, R. (2015)
*Spatial Point Patterns: Methodology and Applications with R*.
Chapman and Hall/CRC Press.

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

Loh, J.M. (2010)
Bootstrapping an inhomogeneous point process.
*Journal of Statistical Planning and Inference*, **140**, 734--749.

##### 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)
g <- lohboot(simdat, stoyan=0.5, block=TRUE)
g
plot(g)
# }
```

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