compute.maxent: Compute MaxEnt model

View source: R/compute.maxent.R

compute.maxentR Documentation

Compute MaxEnt model

Description

Compute species distribution models with MaxEnt (Maximum Entropy)

Usage

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

  • model$algorithm "maxent" string character

  • model$data x dataframe that was used to implement the model

  • model$response Parameters returned by the model object

  • model$raster.prediction Raster layer that predicts the potential species distribution

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.

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

Examples

#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 some environmental predictors
data(predictors2005_2012)
envi <- predictors2005_2012
envi

#Create a SDMtab matrix
SDMtable_ctenocidaris <- SDMPlay:::SDMtab(xydata=occ,
                                         predictors=predictors2005_2012,
                                         unique.data=FALSE,
                                         same=TRUE)

#only run if the maxent.jar file is available, in the right folder
#jar <- paste(system.file(package="dismo"), "/java/maxent.jar", sep='')
# Check first if maxent can be run (normally not part of your script)
# (file.exists(jar) & require(rJava)) == TRUE ??
# rJava may pose a problem to load automatically within this package
# please load it manually using eventually the archives available from CRAN

# Run the model
#model <- SDMPlay:::compute.maxent(x=SDMtable_ctenocidaris, 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)
data('worldmap')
# add data
points(worldmap, type="l")
#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


charleneguillaumot/SDMPlay documentation built on Feb. 2, 2023, 1:09 p.m.