Include Maxent Biomod2
Include Maxent Biomod2
November 5, 2012
1
biomod2: include MAXENT CONTENTS
Contents
1 Introduction 3
2 Java software 3
2.1 Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Linux and Mac OS . . . . . . . . . . . . . . . . . . . . . . . . 4
3 MAXENT software 4
4 A little test 5
2
biomod2: include MAXENT 2 JAVA SOFTWARE
1 Introduction
This vignette explain how to configure your computer to run MAXENT within
biomod2.
2 Java software
Given MAXENT is a java software, a Java interpreter needs to be installed on
your computer. Skip the following step if Java is already installed on your
machine. We consider here the three most usual OS (i.e. Windows, Linux
and Mac OS).
2.1 Windows
These instructions concern Windows 7, but should work with former XP
and Vista.
1. Download and install the latest version of the Java Platform, Standard
Edition Development Kit (http://www.oracle.com/technetwork/java/
javase/downloads/index.html).
NOTE 1 :
the installation directory for later is probably something like C:\ProgramFiles\
Java\jdkx.x.x_xx\bin.
NOTE 2 :
Replace the x.x.x xx by jdk version
NOTE 3 :
In Vista:
select Start → My Computer → Properties → Advanced → En-
vironment Variables → System variables → PATH
NOTE 4 :
In Windows XP:
3
biomod2: include MAXENT 3 MAXENT SOFTWARE
3. make a test :
3 MAXENT software
To run MAXENT you need a copy of the maxent.jar file in your working
directory (where R and biomod2 will be run).
3. put a copy maxent.jar file somewhere on your hard drive (in your
working directory by default).
NOTE 5 :
If you don’t put maxent.jar file in your working directory, you will have to
fill the path_to_maxent.jar MAXENT options argument with the link to
this file.
4
biomod2: include MAXENT 4 A LITTLE TEST
4 A little test
If you have followed the previous sections, you should be able to use MAXENT
as all other models in biomod2. Let’s try it with the biomod2 data.
R input
# load the library
library(biomod2)
# load our species raster
# we consider only the presences of Myocastor coypus species
myResp.ras <- raster( system.file(
"external/species/Myocastor_coypus.img",
package="biomod2") )
# extract the presences data
# the name
myRespName <- 'Myocastor'
# the XY coordinates of the presence
myRespXY <- xyFromCell(object=myResp.ras,
cell=which(myResp.ras[]>0))
# and the presence data
myResp <- extract(x=myResp.ras, y=myRespXY)
# load the environmental raster layers (could be .img, ArcGIS
# rasters or any supported format by the raster package)
5
biomod2: include MAXENT 4 A LITTLE TEST
quadratic = TRUE,
product = TRUE,
threshold = TRUE,
hinge = TRUE,
lq2lqptthreshold = 80,
l2lqthreshold = 10,
hingethreshold = 15,
beta_threshold = -1,
beta_categorical = -1,
beta_lqp = -1,
beta_hinge = -1,
defaultprevalence = 0.5))
# 3. Computing the models
myBiomodModelOut <- BIOMOD_Modeling(
myBiomodData,
models = c('SRE','RF','MAXENT'),
models.options = myBiomodOption,
NbRunEval=1,
DataSplit=80,
Yweights=NULL,
VarImport=3,
models.eval.meth = c('TSS','ROC'),
SaveObj = TRUE,
rescal.all.models = TRUE)
# let's have a look at different models scores
getModelsEvaluations(myBiomodModelOut)
# 4. Project our models over studied area
myBiomomodProj <- BIOMOD_Projection(modeling.output = myBiomodModelOut,
new.env = myExpl,
proj.name = 'current',
xy.new.env = myRespCoord,
selected.models = 'all',
binary.meth = 'ROC',
filtered.meth = 'TSS',
compress = 'xz',
clamping.mask = T,
do.stack=T)
# make some plots sub-selected by str.grep argument
plot(myBiomomodProj, str.grep = 'MAXENT')