Spatial Ecology & R
  • Research & Training
  • R Code & Data
  • Other Resources

Spatial Ecology & R
(search via "category" below)

 

11/25/2015

0 Comments

 

Species Distribution Model: DOMAIN

Model Category:
Profile Methods (Multivariate Distance)

Model Description:
The DOMAIN procedure computes potential distributions using a point-to-point similarity metric (Gower metric) to assign a classification value to a candidate site based on the proximity in environmental space of the most similar record site. If you believe the impact of surious outliers is an issue with you data, DOMAIN can be directed to us the mean of a number of largest similarity values rather than the maximum similarity value. The DOMAIN model is particularly well suited to applications where available site location records or environmental data are limited.

Model Assumptions:
The DOMAIN model assumes (1) the species data represent an unbiased sampling of the full range of environmental conditions in the modeling and prediction regions and (2) the environmental variables are measured without error. It is important to note that the potential distribution maps produced using the DOMAIN model may reflect some degree of collection bias.

Model Response Data:
DOMAIN only requires records of species presence and performs well when species occurrence data is scarce. Since the DOMAIN method uses point-to-point distances for each pixel, it performs better when the all the records are closer together in environmental space.

Model Explanatory Data:
Continuous, environmental raster data is necessary.


Model Links and Use with R:
dismo: Species Distribution Modeling (https://cran.r-project.org/web/packages/dismo/index.html)
This package contains functions for species distribution modeling, specifically, predicting entire geographic distributions from occurrences at a number of sites.

Paper describing model:
Carpenter, G., Gillison, A. N., & Winter, J. (1993). DOMAIN: a flexible modelling procedure for mapping potential distributions of plants and animals. Biodiversity & Conservation, 2(6), 667-680.
Available at: http://link.springer.com/article/10.1007/BF00051966


Example Papers:

  1. Hijmans, R. J. and Graham, C. H. (2006), The ability of climate envelope models to predict the effect of climate change on species distributions. Global Change Biology, 12: 2272-2281. doi:10.1111/j.1365-2486.2006.01256.x
    Available at: http://onlinelibrary.wiley.com/doi/10.1111/j.1365-2486.2006.01256.x/full
  2. Hernandez, P. A., Graham, C. H., Master, L. L., & Albert, D. L. (2006). The effect of sample size and species characteristics on performance of different species distribution modeling methods. Ecography, 29(5), 773-785.
    Available at: http://onlinelibrary.wiley.com/doi/10.1111/j.0906-7590.2006.04700.x/epdf

Example with R

Code to load the required packages to run the model.

library(sp)
library(raster)
library(dismo)     # package to run the model
library(maptools)
## Checking rgeos availability: TRUE
data(wrld_simpl)
dismo_path<-paste(system.file(package="dismo"), '/ex', sep='')
files <- list.files(path=dismo_path,pattern='grd', full.names=TRUE)
predictors <- stack(files)
pred_nf <- dropLayer(predictors, 'biome')
modeldata <- read.table(datafile,  header=TRUE,  sep=',')
modeldata[,'biome'] = as.factor(modeldata[,'biome'])
file <- paste(system.file(package="dismo"), "/ex/bradypus.csv", sep="")
bradypus <- read.table(file,  header=TRUE,  sep=',')
bradypus  <- bradypus[,-1]
group <- kfold(bradypus, 5)
pres_train <- bradypus[group != 1, ]
pres_test <- bradypus[group == 1, ]
ext = extent(-90, -32, -33, 23)
backg <- randomPoints(pred_nf, n=1000, ext=ext, extf = 1.25)
colnames(backg) = c('lon', 'lat')
group <- kfold(backg, 5)
backg_train <- backg[group != 1, ]
backg_test <- backg[group == 1, ]
r = raster(pred_nf, 1)
plot(!is.na(r), col=c('white', 'light grey'), legend=FALSE)
plot(ext, add=TRUE, col='red', lwd=2)
points(backg_train, pch='-', cex=0.5, col='yellow')
points(backg_test, pch='-',  cex=0.5, col='black')
points(pres_train, pch= '+', col='green')
points(pres_test, pch='+', col='blue')

dm <- domain(pred_nf, pres_train)
e <- evaluate(pres_test, backg_test, dm, pred_nf)
e
## class          : ModelEvaluation 
## n presences    : 23 
## n absences     : 200 
## AUC            : 0.756087 
## cor            : 0.2597789 
## max TPR+TNR at : 0.4687172
pd = predict(pred_nf, dm, ext=ext, progress='')
#par(mfrow=c(1,2))
plot(pd, main='Domain, raw values')
plot(wrld_simpl, add=TRUE, border='dark grey')
tr <- threshold(e, 'spec_sens')
plot(pd > tr, main='presence/absence')
plot(wrld_simpl, add=TRUE, border='dark grey')
points(pres_train, pch='+')


Reduced Model

pred_reduced <- dropLayer(pred_nf, c(3,4,6,7,8))
backg_reduced <- randomPoints(pred_reduced, n=1000, ext=ext, extf = 1.25)
colnames(backg_reduced) = c('lon', 'lat')
group_reduced <- kfold(backg_reduced, 5)
backg_train_reduced <- backg_reduced[group != 1, ]
backg_test_reduced <- backg_reduced[group == 1, ]
r_reduced = raster(pred_reduced, 1)
plot(!is.na(r_reduced), col=c('white', 'light grey'), legend=FALSE)
plot(ext, add=TRUE, col='red', lwd=2)
points(backg_train_reduced, pch='-', cex=0.5, col='yellow')
points(backg_test_reduced, pch='-',  cex=0.5, col='black')
points(pres_train, pch= '+', col='green')
points(pres_test, pch='+', col='blue')

dm_reduced <- domain(pred_reduced, pres_train)
e_reduced <- evaluate(pres_test, backg_test_reduced, dm_reduced, pred_reduced)
e_reduced
## class          : ModelEvaluation 
## n presences    : 23 
## n absences     : 200 
## AUC            : 0.7079348 
## cor            : 0.1633281 
## max TPR+TNR at : 0.8306266
pd_reduced = predict(pred_reduced, dm_reduced, ext=ext, progress='')
#par(mfrow=c(1,2))
plot(pd_reduced, main='Domain, Reduced Model')
plot(wrld_simpl, add=TRUE, border='dark grey')
tr_reduced <- threshold(e_reduced, 'spec_sens')
plot(pd_reduced > tr_reduced, main='Reduced Model presence/absence')
plot(wrld_simpl, add=TRUE, border='dark grey')
points(pres_train, pch='+')



Comparing the Prediction Maps

plot(pd, main='Domain, Full Model')
plot(wrld_simpl, add=TRUE, border='dark grey')
plot(pd_reduced, main='Domain, Reduced Model')
plot(wrld_simpl, add=TRUE, border='dark grey')