Learn R Programming

spatstat.explore (version 3.7-0)

bw.relriskHeatppp: Bandwidth Selection for Relative Risk using Diffusion

Description

Performs data-based bandwidth selection for the diffusion estimate of relative risk relriskHeat.ppp using either likelihood cross-validation or least squares

Usage

bw.relriskHeatppp(X, ..., method = c("likelihood", "leastsquares"),
            weights = NULL, srange = NULL, ns = 16, sigma = NULL,
            leaveoneout = TRUE, verbose = TRUE)

Arguments

Value

A numerical value giving the selected bandwidth (if sigma was a numeric value) or the selected fraction of the maximum bandwidth (if sigma was a pixel image or function). The result also belongs to the class "bw.optim" which can be plotted.

Details

This algorithm selects the optimal global bandwidth for kernel estimation of relative risk for the dataset X using diffusion smoothing relriskHeat.

If sigma is a numeric value, the algorithm finds the optimal bandwidth tau <= sigma.

If sigma is a pixel image or function, the algorithm finds the optimal fraction 0 < f <= 1 such that smoothing with f * sigma would be optimal.

See Also

relriskHeat.ppp

Examples

Run this code
  ## bovine tuberculosis data
  X <- subset(btb, select=spoligotype)
  if(interactive()) {
    smax <- 40
    ns <- 16
    dimyx <- NULL
  } else {
    ## reduce data and resolution to speed up
    X <- X[c(TRUE, rep(FALSE, 7))]
    smax <- 9
    ns <- 8
    dimyx <- 32
  }
  b <- bw.relriskHeatppp(X, sigma=smax, ns=ns, dimyx=dimyx)
  b
  plot(b) 

Run the code above in your browser using DataLab