Learn R Programming

spatstat.explore (version 3.3-3)

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)

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.

Arguments

X

A multitype point pattern (object of class "ppp").

...

Arguments passed to relriskHeat.ppp.

method

Character string specifying the cross-validation method. Partially matched to "likelihood" for binary likelihood cross-validation or "leastsquares" for least squares cross-validation.

weights

Optional numeric vector of weights associated with each point of X.

srange

Numeric vector of length 2 specifying a range of bandwidths to be considered.

ns

Integer. Number of candidate bandwidths to be considered.

sigma

Maximum smoothing bandwidth. A numeric value, or a pixel image, or a function(x,y). Alternatively a numeric vector containing a sequence of candidate bandwidths.

leaveoneout

Logical value specifying whether intensity values at data points should be estimated using the leave-one-out rule.

verbose

Logical value specifying whether to print progress reports.

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Tilman Davies Tilman.Davies@otago.ac.nz and Suman Rakshit.

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