Learn R Programming

spNetwork (version 0.2.1)

nkde_worker_bw_sel_cvl: Worker function for bandwidth selection by Cronie and Van Lieshout's Criterion

Description

The worker function for bandwidth selection by Cronie and Van Lieshout's Criterion

Usage

nkde_worker_bw_sel_cvl(
  lines,
  events,
  samples,
  kernel_name,
  bws,
  method,
  div,
  digits,
  tol,
  sparse,
  max_depth,
  verbose = FALSE
)

Arguments

lines

A SpatialLinesDataFrame representing the underlying network. The geometries must be a SpatialLinesDataFrame (may crash if some geometries are invalid)

events

A SpatialPointsDataFrame representing the events on the network.

samples

A SpatialPointsDataFrame representing the samples on the network.

kernel_name

The name of the kernel to use. Must be one of triangle, gaussian, tricube, cosine ,triweight, quartic, epanechnikov or uniform.

bws

A vector with all the bandiwdths to test.

method

The method to use when calculating the NKDE, must be one of simple / discontinuous / continuous (see details for more information)

div

The divisor to use (should always be dist here).

digits

The number of digits to retain in the spatial coordinates. It ensures that topology is good when building the network. Default is 3

tol

When adding the events and the sampling points to the network, the minimum distance between these points and the lines' extremities. When points are closer, they are added at the extremity of the lines.

sparse

A Boolean indicating if sparse or regular matrix should be used by the Rcpp functions. Regular matrix are faster, but require more memory and could lead to error, in particular with multiprocessing. Sparse matrix are slower, but require much less memory (not used for the moment).

max_depth

when using the continuous and discontinuous methods, the calculation time and memory use can go wild if the network has many small edges (area with many of intersections and many events). To avoid it, it is possible to set here a maximum depth. Considering that the kernel is divided at intersections, a value of 10 should yield good estimates in most cases. A larger value can be used without a problem for the discontinuous method. For the continuous method, a larger value will strongly impact calculation speed.

verbose

A Boolean, indicating if the function should print messages about the process.

agg

A double indicating if the events must be aggregated within a distance. If NULL, the events are aggregated by rounding the coordinates.

Value

A list of dataframes (continuous kernel) or a list of numeric vectors (other kernels).

Examples

Run this code
# NOT RUN {
#This is an internal function, no example provided
# }

Run the code above in your browser using DataLab