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-valiation test and training datasets of the observed cases are generated by k-fold sampling without replacement.

Usage

1
2
3
lemXv(cases, population, cellsCoarse, cellsFine, bw, xv = 4, lemObjects,
  ncores = 1, iterations = list(tol = 1e-05, maxIter = 1000, gpu = FALSE),
  randomSeed = NULL, path = getwd(), 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

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

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 a raster of the risk estimation of the bandwidth with the lowest cross-validiation score.


localEM documentation built on Sept. 8, 2017, 3:01 a.m.

Related to lemXv in localEM...