| mem | R Documentation |
Computes Moran's Eigenvector Maps (MEMs) from a distance matrix. Returns only eigenvectors with positive spatial autocorrelation, which capture broad to medium-scale spatial patterns.
mem(distance.matrix = NULL, distance.threshold = 0, colnames.prefix = "mem")
distance.matrix |
Numeric distance matrix between spatial locations. |
distance.threshold |
Numeric value specifying the maximum distance for spatial neighbors. Distances above this threshold are set to zero. Default: |
colnames.prefix |
Character string used as prefix for column names in the output. Default: |
Moran's Eigenvector Maps (MEMs) are spatial variables that represent spatial structures at different scales. The function creates MEMs through the following steps:
Double-centers the distance matrix using double_center_distance_matrix()
Computes eigenvectors and eigenvalues using base::eigen()
Normalizes eigenvalues by dividing by the maximum absolute eigenvalue
Selects only eigenvectors with positive normalized eigenvalues
Positive vs. negative eigenvalues:
Eigenvectors with positive eigenvalues represent positive spatial autocorrelation (nearby locations are similar), capturing broad to medium-scale spatial patterns. Eigenvectors with negative eigenvalues represent negative spatial autocorrelation (nearby locations are dissimilar) and are excluded. The returned MEMs are ordered by eigenvalue magnitude, with the first columns capturing the broadest spatial patterns.
These MEMs are used as spatial predictors in rf_spatial() to account for spatial autocorrelation in model residuals.
Data frame where each column is a MEM (spatial predictor) representing a different scale of spatial pattern. Columns are named with the pattern <prefix>_<number> (e.g., "mem_1", "mem_2").
mem_multithreshold(), rf_spatial(), double_center_distance_matrix()
Other spatial_analysis:
filter_spatial_predictors(),
mem_multithreshold(),
moran(),
moran_multithreshold(),
pca(),
pca_multithreshold(),
rank_spatial_predictors(),
residuals_diagnostics(),
residuals_test(),
select_spatial_predictors_recursive(),
select_spatial_predictors_sequential()
data(plants_distance)
# Compute MEMs from distance matrix
mems <- mem(distance.matrix = plants_distance)
# View structure
head(mems)
dim(mems)
# Check column names
colnames(mems)[1:5]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.