# Selection of an optimal spatial weighting matrix
# 1. Search based on Delaunay triangulation.
#
We use mite.h.det as response data and mite.del as Delaunay
#
triangulation data.
#
No weighting matrix (binary weights only): 1 means connected
#
(easy communication), 0 = not connected (no exchange
#
possible). Function test.W() selects among the MEM variables
#
constructed on the basis of the Delaunay triangulation.
# Delaunay triangulation and model selection
(mite.del <- tri2nb(mite.xy))
mite.del.res mite.del,
MEM.autocor = "positive")
The screen output says that the best model has an AICc value of -93.87 and is
based on 6 MEM variables.
# Summary of the results for the best model
summary(mite.del.res$best)
# Unadjusted R^2 of the model with the smallest AICc value
(R2.del # Adjusted R^2 of the model with the smallest AICc value
RsquareAdj(
R2.del,
n = nrow(mite.h.det),
m = which.min(mite.del.res$best$AIC$AICc)
)
# 2. Delaunay triangulation weighted by a function of distance.
#
Distances are ranged to maximum 1, and raised to power y.
#
After transformation of the distances by function f2, values
#
near 1 are attributed to pairs of sites with easy exchange,
#
values near 0 mean difficult communication.
f2 <- function(D, dmax, y)
{
1 - (D/dmax)^y
}
# Largest Euclidean distance on links belonging to the Delaunay
# triangulation
max.d1 <- max(unlist(nbdists(mite.del, as.matrix(mite.xy))))
# Power y is set from 2 to 10
mite.del.f2 MEM.autocor = "positive",
f = f2,
y = 2:10,
dmax = max.d1,
xy = as.matrix(mite.xy))
336
7 Spatial Analysis of Ecological Data
Précédent

- 347/444

Suivant