The output interpretation and test of robustness
The output interpretation and test of robustness
Evaluate the robustness of the projections: the MESS index - Step 1/2
The projections made outside the model training range (the native range) should be treated carefully. An artefact in the extrapolation is possible and it is very important to evaluate where the extrapolation could be particularly critical. Elith et al. (2010) proposed a Multivariate Environmental Similarity Surfaces (MESS) index to take into account this issue. The MESS is an index of similarity reporting the closeness of a point described by a set of environmental attributes to the distribution of these attributes within a population of reference points.
In the strings below, we will load one of the biomod output, called “formated.input.data”, from where it is possible to get the coordinates of the points used for the training of the model (we will perform the MESS analysis just for the first replicate). Then we will re-load the rasters of the environmental variables selected in the previous models and finally apply the mess() function provided by the dismo R package.
> ## load single models files
> s<-list.files(getwd(), "formated.input.data", recursive=T, full.names=T, all.files=T)<%6%5%>
> load(s[1])
> s<-grep("data", ls(), value=T)<%6%5%>
> mydata<-get(s)<%6%5%>
> # extract training dataset
> dataset<-mydata@coord<%6%5%>
> # perform MESS analysis (it may takes several minutes)
> library(dismo)
> library(gtools)
The mess function requires the stack of the environmental variables (vars_proj) and the values of the same variables extracted at the occurrence points:
> r <- getData("worldclim", var = "bio", res = 2.5)<%6%5%> > vars_training<-stack(mixedsort(list.files("predictors\\", "gri", full.names=T)))<%6%5%> > r<-r[[which(names(r)%in%names(vars_training))]]<%6%5%> > vars_proj<-stack(aggregate(r, 5, progress="text"))<%6%5%>