ENMeval 'aic.maxent' vs 'calc.aicc'

223 views
Skip to first unread message

Guilherme S. Grittz

unread,
Aug 2, 2022, 12:08:24 PM8/2/22
to Maxent
Hello,

I'm having some issues understanding the new function 'aic.maxent' and what is necessary to fit it. In the older ENMeval version, the function was

calc.aicc(nparam, occ, predictive.maps)
get.params(model) where

 nparam: The number of parameters in a model calculated with the get.params function.

occ: A data.frame of occurrence localities. 

predictive.maps: A raster layer or RasterStack of predicted model surface(s). 

model: A Maxent model object generated by the maxent function in the dismo package.  

In this version I'll simply do:
AIC=calc.aicc(get.params(md1),occ[,1:2],r)[1,1] where,
md1 = my model;
occ[, 1:2] = longitude and latitude;
r = my predicted raster from r=predict(md1,env$current,args=c("outputformat=raw"))

@@@@@@@@@@

Now, the function is aic.maxent(p.occs, ncoefs, p = NULL) where,

p.occs = dataframe: raw (maxent.jar) or exponential (maxnet) predictions for the occurrence localities based on one or more models;

ncoefs = numeric: number of non-zero model coefficients

p = RasterStack: raw(maxent.jar) or exponential (maxnet) model predictions; if NULL, AICc will be calculated based on the background points, which already have predictions that sum to 1 and thus need no correction — this assumes that the background points represent a good sample of the study extent

I seem unable to find the correct data to insert into the function. Did other functions change as well? Because I used to model on dismo and use ENMeval to evaluate via AICc (ggrittz/pecon_treeferns: Replication codes and data for "Expected impacts of climate change on tree ferns distribution and diversity patterns in subtropical Atlantic Forest" (github.com), see 01_dismo_edit.R and 02_maxent.R for more info)

Cheers,

Jamie M. Kass

unread,
Sep 23, 2022, 6:57:21 PM9/23/22
to Maxent
The calc.aicc() function in ENMeval is meant to be used internally. When you run ENMevaluate(), the output table in the @results slot (or accessible with eval.results()) will have the AICc value, along with delta.AICc (the model with 0 will have optimal settings via AICc because it's the one with the lowest value, though models with <2 or so are equally as good), and the AICc weights. Not sure why you'd need to run this outside ENMevaluate(), but p.occs is a data.frame of predicted suitability values for the occurrence points (just a single column), ncoefs is the number of non-zero coefficients from "e@results", where e is an ENMevaluation object (product of ENMevaluate()), and p is a RasterStack of the predictor variables. If you leave p to be NULL, instead of weighting the occurrence suitability predictions by those of the entire study extent (the way ENMevaluate() has always worked up to v2), AICc can be calculated without this weighting, which is based on the assumption that the background is a good representation of the study extent. The reason for this feature is so that models tuned without raster data (SWD = species with data format) can also have AICc calculated. The documentation details these assumptions, but I might tweak it to make the parameterization more straightforward in the next version. Thanks for the comment, and I hope this clears it up.

Jamie
Reply all
Reply to author
Forward
0 new messages