listw.candidates {adespatial}  R Documentation 
This function is a userfriendly way to create a list of one or several spatial weighting matrices (SWM) by selecting a set of predefined connectivity and weighting matrices (B and A matrices, respectively).
listw.candidates( coord, style = "B", nb = c("del", "gab", "rel", "mst", "pcnm", "dnear"), d1 = 0, d2, weights = c("binary", "flin", "fup", "fdown"), y_fdown = 5, y_fup = 0.5 )
coord 
Vector, matrix, or dataframe of point coordinates 
style 
Coding scheme style (see 
nb 
Defines how the B matrix (connectivity) is build:

d1 
Only considered if 
d2 
Only considered if 
weights 
Defines how the A matrix (weighths) is build:

y_fdown 
Single value or vector of values of the 
y_fup 
Single value or vector of values of the 
The function allows constructing SWMs based on any combination
of B and A matrices. The B matrices are either graphbased or
distancebased. The function proposes the Delaunay triangulation, Gabriel
graph, relative neighbourhood graph, and the minimum spanning tree criteria
to build a graphbased B matrix. Distancebased SWMs can be built
with the principal coordinates of neighbour matrices (PCNM; Borcard and
Legendre 2002) criteria (see details below), or using another threshold
distance to define the connected site pairs. The A matrix can be based on a
binary, linear, concavedown, or concaveup function. The linear,
concavedown, and concaveup weighting functions are defined by 1 
(D/dmax), 1  (D/dmax)^y, and 1 / D^y, respectively, where
D
is the euclidean distance between the two sites considered,
dmax
is the maximum euclidean distance between two sites, and
y
is a userdefined parametre that can either be a single value or a
vector of values. The choice nb = "pcnm"
consists in constructing a
distancebased SWM based on the largest edge of the minimum spanning
tree as a connectivity distance threshold, and then by weighting the links
by the function 1(D/(4*t))^2, where D
is the euclidean
distance between the sites, and t
is the distance threshold below
which two sites are considered connected (Dray et al. 2006). As optimizing
the choice of a SWM has to be done with a pvalue correction depending
on the number of candidate SWMs tested (see function
listw.select
), Bauman et al. (2018) strongly encouraged plotting the
concavedown and concaveup weighting functions with several parametre
values in order to only choose the realistic ones to build the candidate W
matrices (e.g., ranging between 0.1 and 1 for the concaveup function, as
values over 1 would make no ecological sense). First visualizing the
connectivity schemes with the listw.explore
function may also help
choosing the B matrices to select for the listw.candidates
function.
Spatial eigenvectors can be generated from any candidate SWM obtained by
listw.candidates
using scores.listw
, or can be generated
and tested (recommended option for real data analysis) using
mem.select
. If several SWMs were created, the selection of an
optimized SWM can be made using listw.select
.
A list of SWMs. Each element of the list was built by
nb2listw
(package spdep
) and therefore is of class
listw
and nb
. The name of each element of the list (SWM)
is composed of the corresponding B and A matrices, followed (if any) by the
y
parameter value of the weighting function.
David Bauman (dbauman@ulb.ac.be or davbauman@gmail.com) and Stéphane Dray
Bauman D., Fortin MJ., Drouet T. and Dray S. (2018) Optimizing the choice of a spatial weighting matrix in eigenvectorbased methods. Ecology
Borcard D. and Legendre P. (2002) Allscale spatial analysis of ecological data by means of principal coordinates of neighbour matrices. Ecological Modelling, 153, 51–68
Dray S., Legendre P. and PeresNeto P. R. (2006) Spatial modeling: a comprehensive framework for principal coordinate analysis of neighbor matrices (PCNM). Ecological Modelling, 196, 483–493
listw.explore
, scores.listw
, mem.select
, listw.select
### Create 100 random sampling locations in a squared grid of 120 x 120: xy < matrix(nrow = 100, ncol = 2) xy[, 1] < sample(c(1:120), 100, replace = FALSE) xy[, 2] < sample(c(1:120), 100, replace = FALSE) ### The function listw.candidates is used to build the spatial weighting matrices that ### we want to test and compare (with the listw.select function). We test a Gabriel's graph, ### a minimum spanning tree, and a distancebased connectivity defined by a threshold ### distance corresponding to the smallest distance keeping all sites connected (i.e., ### the defaut value of d2). These connectivity matrices are then either not weighted ### (binary weighting), or weighted by the linearly decreasing function: candidates < listw.candidates(coord = xy, nb = c("gab", "mst", "dnear"), weights = c("binary", "flin")) names(candidates) plot(candidates[[1]], xy) plot(candidates[[3]], xy) ### Construction of a different list of spatial weighting matrices. This time, the ### connexions are defined by a distancebased criterion based on the same threshold ### value, but the connections are weighted by the concavedown function with a y parameter ### varying between 2 and 5, and a concaveup function with a y parametre of 0.2. candidates2 < listw.candidates(coord = xy, nb = "dnear", weights = c("fdown", "fup"), y_fdown = 1:5, y_fup = 0.2) ### Number of spatial weighting matrices generated: length(candidates2) ### A single SWM can also easily be generated with listw.candidates: lw < listw.candidates(xy, nb = "gab", weights = "bin") plot(lw[[1]], xy) ### Generating MEM variables from an object of listw.candidates with scores.listw: MEM < scores.listw(lw[[1]]) ### See functions mem.select and listw.select for examples of how to use an object ### created by listw.candidates with these functions.