correction_factor: Border correction for NKDE

Description Usage Arguments Value Examples

View source: R/border_correction.R

Description

Function to calculate the border correction factor.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
correction_factor(
  study_area,
  events,
  lines,
  method,
  bws,
  kernel_name,
  tol,
  digits,
  max_depth,
  sparse
)

Arguments

study_area

A SpatialPolygonsDataFrame or a SpatialPolygons, the limit of the study area.

events

A SpatialPointsDataFrame representing the events on the network.

lines

The lines used to create the network

method

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

bws

The kernel bandwidth (in meters) for each event

kernel_name

The name of the kernel to use

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.

digits

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

max_depth

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

sparse

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

Value

A numeric vector with the correction factor values for each event

Examples

1
#no example provided, this is an internal function

spNetwork documentation built on Oct. 30, 2021, 5:06 p.m.