# bw.relrisk

##### Cross Validated Bandwidth Selection for Relative Risk Estimation

Uses cross-validation to select a smoothing bandwidth for the estimation of relative risk.

##### Usage

`bw.relrisk(X, method = "likelihood", nh = 32)`

##### Arguments

- X
- A multitype point pattern (object of class
`"ppp"`

which has factor valued marks). - method
- Character string determining the cross-validation method.
Current options are
`"likelihood"`

,`"leastsquares"`

or`"weightedleastsquares"`

. - nh
- Number of trial values of smoothing bandwith
`sigma`

to consider.

##### Details

This function selects an appropriate bandwidth for the nonparametric
estimation of relative risk using `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.relrisk"`

allowing it to be printed and plotted. The plot shows the cross-validation
criterion as a function of bandwidth.

##### Value

- A numerical value giving the selected bandwidth.
The result also belongs to the class
`"bw.relrisk"`

.

##### References

Diggle, P.J. (2003)
*Statistical analysis of spatial point patterns*,
Second edition. Arnold.

##### See Also

##### Examples

```
data(urkiola)
b <- bw.relrisk(urkiola)
b
plot(b)
```

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