Learn R Programming

codep (version 0.2-1)

eigenmap: Spatial eigenvector maps

Description

Function to spatial eigenvector maps of a set of locations in a space with an arbitrary number of dimension.

Usage

eigenmap(x,opt.coord=NA,truncate=c(0,NA),wf,wpar,select=.Machine$double.eps^0.5)

Arguments

x
A set of coordinates defined in one (numeric vector) or many (a coordinate x dimension matrix) dimensions or, alternatively, a distance matrix provided by dist. Coordinates are treated as geographi
opt.coord
Coordinates to be used when a distance matrix is provided as x. Used for plotting purposes.
truncate
Threshold values (minimum and maximum) used to obtain the connectivity matrix. Pairs of location whose distance to one another are between these values are considered as neighbours ($b_{i,j}=1$) whereas values located below the mininum and
wf
Choice of a function to obtain the edge weighting matrix: binary (default value) refers to the identity function (The spatial weighting matrix is simply the connectivity matrix),

dbMEM is $a_{i,j} = 1 - (d_{i,j} / (4*t

wpar
Exponent in weighting function Drayf2 and Drayf3. Ignored when weighting is binary, dbMEM, Drayf1, or sqrd.
select
The smallest absolute eigenvalue for eigenfunctions to be considered as a suitable predictive variables. Default value depends on one's particular machine and is set to the square-root of .Machine$double.eps

Value

encoding

utf8

Details

Spatial eigenvector maps are sets of eigenfunctions obtained from the locations of the observations in a structuring framework, e.g., space, time, or in a graph. It is obtained by eigenvalue decomposition of a spatial weighting matrix, computed as described in Dray et al. (2006) and Legendre & Legendre (2012, Section 14.2). That square matrix is Gower-centred before eigen-decomposition. The spatial weighting matrix is the Hadamard product of a connectivity matrix $\mathbf{B}$ and an edge weighting matrix $\mathbf{A}$. The function described herein handles user-chosen truncation parameters to calculate $\mathbf{B}$ and provides a default approach to estimate these parameters should they be missing. It also offers four different ways of computing $\mathbf{A}$ through parameters weighting and wpar.

In is noteworthy that in the present implementation, matrix $\mathbf{B}$ is not obtained using a minimum spanning tree as suggested by Dray et al. (2006) but using a simpler approach whereby every distances within a user-defined trunction interval are taken as neighbour.

References

Dray, S.; Legendre, P. and Peres-Neto, P. 2006. Spatial modelling: a comprehensive framework for principal coordinate analysis of neighbor matrices (PCNM). Ecol. Modelling 196: 483-493

Legendre, P. and Legendre, L. 2012. Numerical Ecology, 3rd English edition. Elsevier Science B.V., Amsterdam, The Neatherlands.

See Also

MCA eigenmap-class

Examples

Run this code
#
### Example 1: A linear transect.
#
data(Salmon)
map <- eigenmap(x=Salmon[,"Position"],truncate=c(0,20),wf="sqrd")
map
plot(map)   # Same as basis functions in type II Discrete Cosine Transforms.
#
map <- eigenmap(x=Salmon[,"Position"],truncate=c(0,20),wf="Drayf1")
map
plot(map)   # Seem like some undifined-type Discrete Sine Transform basis functions
#
map <- eigenmap(x=Salmon[,"Position"],truncate=c(0,20),wf="Drayf2",wpar=2)
map
plot(map)
#
map <- eigenmap(x=Salmon[,"Position"],truncate=c(0,20),wf="Drayf3",wpar=2.4)
map
plot(map)
#
map <- eigenmap(x=Salmon[,"Position"],truncate=c(0,20),wf="dbMEM")
map
plot(map)   # Similar to Drayf1.
#
### Example 2: A unevenly sampled surface.
#
## Require package vegan
library(vegan)
data(mite.xy)
map <- eigenmap(x=as.matrix(mite.xy),truncate=c(0,NA),wf="sqrd")
map
plot(map)

Run the code above in your browser using DataLab