The function BRISC_neighbor creates the set of nearest neighbors for a given set of coordinates, which can be used as an input
for "neighbor" argument in BRISC_estimation. This is especially useful for avoiding often computationally
intensive nearest neighbor finding scheme in case of multiple application of BRISC_estimation on a fixed set of
coordinates.
BRISC_neighbor(coords, n.neighbors = 15, n_omp = 1,
order = "Sum_coords", search.type = "tree",
verbose = TRUE, ordering = NULL, tol = 12
)A list containing information regarding nearest neighbors which can be used as an input
for "neighbor" argument in BRISC_estimation.
an \(n \times 2\) matrix of the observation coordinates in \(R^2\) (e.g., easting and northing).
number of neighbors used in the NNGP. Default value is 15.
number of threads to be used, value can be more than 1 if source code is compiled with OpenMP support. Default is 1.
keyword that specifies the ordering scheme to be used in ordering the observations. Supported keywords are:
"AMMD" and "Sum_coords" for approximate Maximum Minimum Distance and sum of coordinate based ordering,
respectively. Default value is "Sum_coords". \(n > 65\) is required for "AMMD". Ignored, if ordering in not NULL.
keyword that specifies type of nearest neighbor search algorithm to be used. Supported keywords are:
"brute", "tree" and "cb".
"brute" and "tree" provide the same result, though
"tree" should be faster. "cb" implements fast code book search described in Ra and Kim (1993)
modified for NNGP. If locations do not have identical coordinate values on the axis used for the nearest neighbor
ordering (see order argument) then "cb" and "brute" should produce identical neighbor sets.
However, if there are identical coordinate values on the axis used for nearest neighbor ordering, then "cb"
and "brute" might produce different, but equally valid, neighbor sets, e.g., if data are on a grid.
Default value is "tree".
if TRUE, information regarding OpenMP support and progress of the algorithm
is printed to the screen. Otherwise, nothing is printed to the screen. Default value is TRUE.
if not NULL, denotes the \(n\) length integer vector of ordering of the input coordinates and is used as the ordering of the coordinates for determination of the set of nearest neighbors.
the input observation coordinates, response and the covariates are rounded to this many places after the decimal. The default value is 12.
Arkajyoti Saha arkajyotisaha93@gmail.com,
Abhirup Datta abhidatta@jhu.edu
Saha, A., & Datta, A. (2018). BRISC: bootstrap for rapid inference on spatial covariances. Stat, e184, DOI: 10.1002/sta4.184.
Datta, A., S. Banerjee, A.O. Finley, and A.E. Gelfand. (2016) Hierarchical Nearest-Neighbor Gaussian process models for large geostatistical datasets. Journal of the American Statistical Association, 111:800-812.
Guinness, J. (2018) Permutation and Grouping Methods for
Sharpening Gaussian Process Approximations, Technometrics,
DOI: 10.1080/00401706.2018.1437476,
https://github.com/joeguinness/gp_reorder/tree/master/R .
set.seed(1)
n <- 1000
coords <- cbind(runif(n,0,1), runif(n,0,1))
neighbor_result <- BRISC_neighbor(coords)
Run the code above in your browser using DataLab