compute.maxent: Compute MaxEnt model

Description Usage Arguments Details Value Note References See Also Examples

Description

Compute species distribution models with MaxEnt (Maximum Entropy)

Usage

1
compute.maxent(x, proj.predictors)

Arguments

x

SDMtab object or dataframe that contains id, longitude, latitude and values of environmental descriptors at corresponding locations.

proj.predictors

RasterStack of environmental descriptors on which the model will be projected

Details

MaxEnt species distribution model minimizes the relative entropy between environmental descriptors and presence data. Further information are provided in the references below.

compute.maxent uses the functionalities of the maxent function. This function uses MaxEnt species distribution software, which is a java program that could be downloaded at https://github.com/charleneguillaumot/SDMPlay. In order to run compute.maxent, put the 'maxent.jar' file downloaded at this address in the 'java' folder of the dismo package (path obtained with the system.file('java', package='dismo') command).

Value

A list of 4

Note

To implement MaxEnt models, Phillips & Dudik (2008) advice a large number of background data. You can also find further information about background selection in Barbet Massin et al. (2012).

References

Barbet Massin M, F Jiguet, C Albert & W Thuiller (2012) Selecting pseudo absences for species distribution models: how, where and how many? Methods in Ecology and Evolution, 3(2): 327-338.

Elith J, S Phillips, T Hastie, M Dudik, Y Chee & C Yates (2011) A statistical explanation of MaxEnt for ecologists. Diversity and Distributions 17:43-57. http://dx.doi.org/10.1111/j.1472-4642.2010.00725.x

Phillips S, M Dudik & R Schapire (2004) A maximum entropy approach to species distribution modeling. Proceedings of the Twenty-First International Conference on Machine Learning : 655-662

Phillips S, R Anderson & R Schapire (2006) Maximum entropy modeling of species geographic distributions. Ecological Modelling 190:231-259.

Phillips S and M Dudik (2008) Modeling of species distributions with MaxEnt: new extensions and a comprehensive evaluation. Ecography 31(2): 161-175.

See Also

maxent .jpackage: initialize dismo for Java

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#Download the presence data
data('ctenocidaris.nutrix')
occ <- ctenocidaris.nutrix
# select longitude and latitude coordinates among all the information
occ <- ctenocidaris.nutrix[,c('decimal.Longitude','decimal.Latitude')]

#Download the environmental predictors restricted on geographical extent and depth (-1500m)
envi <- raster::stack(system.file('extdata', 'pred.grd',package='SDMPlay'))
envi

#Open SDMtab matrix
x <- system.file(file='extdata/SDMdata1500.csv',package='SDMPlay')
SDMdata <- read.table(x,header=TRUE, sep=';')

#only run if the maxent.jar file is available, in the right folder
jar <- paste(system.file(package="dismo"), "/java/maxent.jar", sep='')
# checking if maxent can be run (normally not part of your script)
if (file.exists(jar) & require(rJava)) {

# Run the model
model <- SDMPlay:::compute.maxent(x=SDMdata , proj.predictors=envi)

# Plot the map prediction
library(grDevices) # add nice colors
palet.col <- colorRampPalette(c('deepskyblue','green','yellow','red'))(80)
#'raster::plot(model$raster.prediction, col=palet.col)
# add data
points(occ, col='black',pch=16)

# Get the partial dependance curves
dismo::response(model$response)

# Get the percentage of contribution of each variable to the model
#plot(model$response)

# Get all the information provided by the model on a html document
model$response

# SECOND EXAMPLE: projecting the model on another period
# Remark: to predict on a different RasterStack, the rasterlayer names of the two
# stacks must be the same and the number of layers must be the same as well.
# Changes have been done in this example by attributing similar names to pred
# and pred2000 stacks and adding extra blank layers (NA layers) to pred2000 stack.
envi2000 <- raster::stack(system.file('extdata', 'pred2000.grd',package='SDMPlay'))

# run the model
model2 <- SDMPlay:::compute.maxent(x=SDMdata, proj.predictors=envi2000)

# plot the new predicting map
raster::plot(model2$raster.prediction, col=palet.col)
# add data
points(occ, col='black',pch=16)}

charleneguillaumot/SDMPlay documentation built on May 13, 2019, 3:30 p.m.