lemXv: Computes the likelihood cross-validation of the raster...

Description Usage Arguments Details Value

View source: R/lemXvFun.R

Description

The lemXv function computes the likelihood cross-validation scores for the observed data with the input bandwidths used for the smoothing matrix. The cross-validation test and training datasets of the observed cases are generated by k-fold sampling without replacement.

Usage

1
2
3
4
lemXv(cases, population, cellsCoarse, cellsFine, bw, fact = 1, xv = 4,
  lemObjects, ncores = 1, iterations = list(tol = 1e-05, maxIter =
  1000, gpu = FALSE), randomSeed = NULL, path = getwd(),
  filename = "riskXv.grd", verbose = FALSE)

Arguments

cases

Spatial polygons with case data

population

Spatial polygons with population data

cellsCoarse

Minimum resolution for rasterization of case data for numerical accuracy of smoothing matrix

cellsFine

Minimum resolution for rasterization of population data for numerical integration of smoothing matrix

bw

Vector of bandwidths

fact

Aggregation factor prior to 'final step' smoothing (set to zero to skip final step)

xv

Number of cross-validation datasets

lemObjects

List of arrays for the smoothing matrix, and raster stacks for the partition and smoothed offsets

ncores

Number of cores/threads for parallel processing

iterations

List of convergence tolerance, number of iterations, and use of gpuR package for running local-EM recursions

randomSeed

Seed for random number generator

path

Folder for storing rasters

filename

Filename (must have .grd extension) of the risk estimation

verbose

Verbose output

Details

After using the lemXv function, a raster stack containing the IDs for the partitions is created by overlaying the spatial polygons of the case and population data. The smoothed offsets and smoothing matrix are computed for the specified bandwidths of each cross-validation set.

Value

The lemXv function returns a data frame of specified bandwidths and their cross-validation scores, and if specified, a raster of the risk estimation of the bandwidth with the lowest cross-validation score.


localEM documentation built on May 3, 2019, 1:24 p.m.

Related to lemXv in localEM...