bw.relrisk(X, method = "likelihood", nh = 32)
"ppp"
which has factor valued marks)."likelihood"
,
"leastsquares"
or
"weightedleastsquares"
.sigma
to consider."bw.relrisk"
.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.
relrisk
data(urkiola)
b <- bw.relrisk(urkiola)
b
plot(b)
Run the code above in your browser using DataLab