Arguments to run Maxent in R

14,512 views
Skip to first unread message

Daisy

unread,
Apr 30, 2012, 1:24:17 AM4/30/12
to Maxent
Hello,

Is there a list of the Arguments that can be used for Maxent in R?

Using google I came across one very ugly source:

http://code.google.com/p/api-maxent-programming/source/browse/trunk/src/edu/berkeley/mvz/amp/MaxEntRun.java?spec=svn15&r=15

This is from 2009 and I know Maxent has more features now.

Thanks,

Daisy

Marwa Waseem

unread,
Apr 30, 2012, 1:48:36 PM4/30/12
to max...@googlegroups.com
Hi Daisy,,

Attached is tutorial for species distribution modelling with R, in that account for the use of Maxent in R. It is not so detailed but I hope it would work for you.
Best,,,,
 

Marwa Waseem



From: Daisy <daisy....@gmail.com>
To: Maxent <max...@googlegroups.com>
Sent: Sunday, April 29, 2012 10:24 PM
Subject: Arguments to run Maxent in R
--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To post to this group, send email to max...@googlegroups.com.
To unsubscribe from this group, send email to maxent+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maxent?hl=en.



Hijmans & Elith (2011) Species distibution modeling with R.pdf

John B

unread,
Apr 30, 2012, 5:18:29 PM4/30/12
to max...@googlegroups.com
You can either use Dismo, which is described in Marwa's attachment, or you can use the system() function to run Maxent from the command line, to have access to all the command line arguments (which is essentially what Dismo is doing anyway... Not sure but you may have more control over it doing it yourself though). Output won't automatically be returned to R, so you'd need to write a few lines to read it in.

cicada

unread,
May 1, 2012, 9:09:17 AM5/1/12
to Maxent
Thanks for the info.....

I should note that our manuscript is not a methods paper and isn't
trying to do anything cutting-edge; we're just trying to figure out
what happened to some populations that went extinct recently. We
built all our models by including the extinct populations in our
distributional dataset, and then we look at where those populations
fall in the resulting models (bad places, mostly). In the end the
models suggest certain things, but they also suggest that this way of
approaching our question is limited.

I've seen discussions about Dismo, but then I found the system()
function in R and, after a bit of fiddling, got everything working
fine (except that I could not allocate as much memory to Maxent as I
usually do). But that's where I'm stuck-- I can read the results into
R, but I'm not entirely sure how to read both those results and the
results of my BIOMOD analyses in together and in a way that would
allow me to do a giant ensemble forecast of everything. Maybe I'm
over thinking this, but I'm also a little concerned that even if I
could do such a thing, I'd be having an apple/oranges problem-- Maxent
is not building or scoring its models in the same ways that the
methods within BIOMOD are. I'm not sure exactly what I'd be getting
by combining everything (assuming that I could find a way to do so),
and I'm not convinced that any such end result would be any better
than laying the Maxent and the BIOMOD ensemble prediction maps down on
top of each other, whipping up some sort of weighted (by what?)
average and calling it "good".

If it was so easy or so legitimate to combine everything and come up
with an ensemble, then everybody would be doing it. But recent
papers, such as this one....

Ballesteros-Mejia, L., Kitching, I.J. & Beck, J. (2011) Projecting the
potential invasion of the Pink Spotted Hawkmoth (Agrius cingulata)
across Africa. International Journal of Pest Management, 57, 153-159.

....are just dealing with Maxent and BIOMOD separately, which is what
we're doing.

So I'm curious about how other people wrestle with these issues......

Daisy

unread,
May 3, 2012, 10:30:25 PM5/3/12
to Maxent
Hello,

Thanks for the replies but I am actually looking for a complete list
of "things" that can be used when you use the args argument to run
Maxent in R. This include things like the nohinge, nothreshold,
replicates, betamultiplier....

Here is an example of my current maxent run but I would like to
include things like Mess Analysis but I do not know the correct
"thing" to call it so I can add it to args. I would also like to know
the correct name for these "things". Is it the arguments for the
argument args?

maxent(x=ev,p=pres,path=paste(new.out.dir),args=c("betamultiplier=1","nohinge","nothreshold","replicates=5","nooutputgrids","projectionlayer=..............

On Apr 30, 3:24 pm, Daisy <daisy.duur...@gmail.com> wrote:
> Hello,
>
> Is there a list of the Arguments that can be used for Maxent in R?
>
> Using google I came across one very ugly source:
>
> http://code.google.com/p/api-maxent-programming/source/browse/trunk/s...

corymerow

unread,
May 4, 2012, 9:12:52 AM5/4/12
to Maxent
hi daisy,
these args appear to be the same syntax as calling maxent from the r
using system as described in post above. you can figure out what to
call each 'thing' by first doing a trial run through maxent's gui with
all the settings you want and then checking the java command at the
bottom of the html summary file. that gives the command for each
thing, which you can then use for all subsequent analyses without
having to deal with the gui. i've found this useful for finding a few
quirks that aren't mentioned in maxent's helpfile (e.g. related to
bias surfaces) or to work around flags that i thought should work, but
didn't.
cory

On May 3, 10:30 pm, Daisy <daisy.duur...@gmail.com> wrote:
> Hello,
>
> Thanks for the replies but I am actually looking for a complete list
> of "things" that can be used when you use the args argument to run
> Maxent in R. This include things like the nohinge, nothreshold,
> replicates, betamultiplier....
>
> Here is an example of my current maxent run but I would like to
> include things like Mess Analysis but I do not know the correct
> "thing" to call it so I can add it to args. I would also like to know
> the correct name for these "things". Is it the arguments for the
> argument args?
>
> maxent(x=ev,p=pres,path=paste(new.out.dir),args=c("betamultiplier=1","nohin ge","nothreshold","replicates=5","nooutputgrids","projectionlayer=......... .....

Gerardo de la Vega

unread,
Dec 4, 2014, 11:01:58 AM12/4/14
to max...@googlegroups.com, daisy....@gmail.com
as said Fred at the bottom from the HELP file there is a complete list:
the list!:
Flag Abbrv Type Default Meaning
responsecurves P boolean false Create graphs showing how predicted relative probability of occurrence depends on the value of each environmental variable
pictures boolean true Create a .png image for each output grid
jackknife J boolean false Measure importance of each environmental variable by training with each environmental variable first omitted, then used in isolation
outputformat string logistic Representation of probabilities used in writing output grids. See Help for details
outputfiletype string asc File format used for writing output grids
outputdirectory o directory Directory where outputs will be written. This should be different from the environmental layers directory.
projectionlayers j file/directory Location of an alternate set of environmental variables. Maxent models will be projected onto these variables.
Can be a .csv file (in SWD format) or a directory containing one file per variable.
Multiple projection files/directories can be separated by commas.
samplesfile s file Please enter the name of a file containing presence locations for one or more species.
environmentallayers e file/directory Environmental variables can be in a directory containing one file per variable,
or all together in a .csv file in SWD format. Please enter a directory name or file name.
randomseed boolean false If selected, a different random seed will be used for each run, so a different random test/train partition
will be made and a different random subset of the background will be used, if applicable.
logscale boolean true If selected, all pictures of models will use a logarithmic scale for color-coding.
warnings boolean true Pop up windows to warn about potential problems with input data.
Regardless of this setting, warnings are always printed to the log file.
tooltips boolean true Show messages that explain various parts of the interface, like this message
askoverwrite r boolean true If output files already exist for a species being modeled,
pop up a window asking whether to overwrite or skip. Default is to overwrite.
skipifexists S boolean false If output files already exist for a species being modeled,
skip the species without remaking the model.
removeduplicates boolean true Remove duplicate presence records.
If environmental data are in grids, duplicates are records in the same grid cell.
Otherwise, duplicates are records with identical coordinates.
writeclampgrid boolean true Write a grid that shows the spatial distribution of clamping.
At each point, the value is the absolute difference between prediction values with and without clamping.
writemess boolean true A multidimensional environmental similarity surface (MESS) shows where novel climate conditions exist in the projection layers.
The analysis shows both the degree of novelness and the variable that is most out of range at each point.
randomtestpoints X integer 0 Percentage of presence localities to be randomly set aside as test points, used to compute AUC, omission etc.
betamultiplier b double 1.0 Multiply all automatic regularization parameters by this number. A higher number gives a more spread-out distribution.
maximumbackground MB integer 10000 If the number of background points / grid cells is larger than this number, then this number of cells is chosen randomly for background points
biasfile file Sampling is assumed to be biased according to the sampling distribution given in this grid file.
Values in this file must not be zero or negative. MaxEnt will factor out the bias.
Requires environmental data to be in grids, rather than a SWD format file
testsamplesfile T file Use the presence localities in this file to compute statistics (AUC, omission etc.)
The file can contain different localities for different species.
It takes precedence over the random test percentage.
replicates integer 1 Number of replicate runs to do when cross-validating, bootstrapping or doing sampling with replacement runs
replicatetype string crossvalidate If replicates > 1, do multiple runs of this type:
Crossvalidate: samples divided into replicates folds; each fold in turn used for test data.
Bootstrap: replicate sample sets chosen by sampling with replacement.
Subsample: replicate sample sets chosen by removing random test percentage without replacement to be used for evaluation.
perspeciesresults boolean false Write separate maxentResults file for each species
writebackgroundpredictions boolean false Write .csv file with predictions at background points
responsecurvesexponent boolean false Instead of showing the logistic value for the y axis in response curves, show the exponent (a linear combination of features)
linear l boolean true Allow linear features to be used
quadratic q boolean true Allow quadratic features to be used
product p boolean true Allow product features to be used
threshold boolean true Allow threshold features to be used
hinge h boolean true Allow hinge features to be used
addsamplestobackground d boolean true Add to the background any sample for which has a combination of environmental values that isn't already present in the background
addallsamplestobackground boolean false Add all samples to the background, even if they have combinations of environmental values that are already present in the background
autorun a boolean false Start running as soon as the the program starts up
writeplotdata boolean false Write output files containing the data used to make response curves, for import into external plotting software
fadebyclamping boolean false Reduce prediction at each point in projections by the difference between
clamped and non-clamped output at that point
extrapolate boolean true Predict to regions of environmental space outside the limits encountered during training
visible z boolean true Make the Maxent user interface visible
autofeature A boolean true Automatically select which feature classes to use, based on number of training samples
doclamp boolean true Apply clamping when projecting
outputgrids x boolean true Write output grids. Turning this off when doing replicate runs causes only the summary grids (average, std deviation etc.) to be written, not those for the individual runs.
plots boolean true Write various plots for inclusion in .html output
appendtoresultsfile boolean false If false, maxentResults.csv file is reinitialized before each run
maximumiterations m integer 500 Stop training after this many iterations of the optimization algorithm
convergencethreshold c double 1.0E-5 Stop training when the drop in log loss per iteration drops below this number
adjustsampleradius integer 0 Add this number of pixels to the radius of white/purple dots for samples on pictures of predictions.
Negative values reduce size of dots.
threads integer 1 Number of processor threads to use. Matching this number to the number of cores on your computer speeds up some operations, especially variable jackknifing.
lq2lqptthreshold integer 80 Number of samples at which product and threshold features start being used
l2lqthreshold integer 10 Number of samples at which quadratic features start being used
hingethreshold integer 15 Number of samples at which hinge features start being used
beta_threshold double -1.0 Regularization parameter to be applied to all threshold features; negative value enables automatic setting
beta_categorical double -1.0 Regularization parameter to be applied to all categorical features; negative value enables automatic setting
beta_lqp double -1.0 Regularization parameter to be applied to all linear, quadratic and product features; negative value enables automatic setting
beta_hinge double -1.0 Regularization parameter to be applied to all hinge features; negative value enables automatic setting
logfile string maxent.log File name to be used for writing debugging information about a run in output directory
cache boolean true Make a .mxe cached version of ascii files, for faster access
defaultprevalence double 0.5 Default prevalence of the species: probability of presence at ordinary occurrence points.
See Elith et al., Diversity and Distributions, 2011 for details.
applythresholdrule string Apply a threshold rule, generating a binary output grid in addition to the regular prediction grid. Use the full name of the threshold rule in Maxent's html output as the argument. For example, 'applyThresholdRule=Fixed cumulative value 1'.
togglelayertype t string Toggle continuous/categorical for environmental layers whose names begin with this prefix (default: all continuous)
togglespeciesselected E string Toggle selection of species whose names begin with this prefix (default: all selected)
togglelayerselected N string Toggle selection of environmental layers whose names begin with this prefix (default: all selected)
verbose v boolean false Gived detailed diagnostics for debugging
allowpartialdata boolean false During model training, allow use of samples that have nodata values for one or more environmental variables.
prefixes boolean true When toggling samples or layers selected or layer types, allow toggle string to be a prefix rather than an exact match.
nodata n integer -9999 Value to be interpreted as nodata values in SWD sample data

El jueves, 23 de mayo de 2013 05:09:32 UTC-3, Fred Feuerstein escribió:
Hey Daisy,

you probably already came across it--run the jar file and hit the help button. There is a complete list of all arguments that maxent accepts and how to pass them to maxent. You use R--check examples in dismo::maxent doc for the syntax arg=c("arg1 arg2 ...")

cheers
Reply all
Reply to author
Forward
0 new messages