Description Usage Arguments Value Warning References Examples
Calculate AIC, AICc, and BIC for Maxent models as in ENMTools.
1 | maxent_IC(x, occ, lambdas)
|
x |
Either a file path to a Maxent raw prediction raster, or a
|
occ |
A |
lambdas |
The path to a Maxent .lambdas file, or a |
An n x 6 matrix, where n is the number of Maxent rasters for which
information criteria are to be calculated. Columns give n
(the
number of occurrence records used for model training), k
(the number
of features with non-zero weights), ll
(the negative log likelihood
of the model), AIC
, AICc
, and BIC
(as calculated in
ENMTools).
These information criteria should not be calculated for models that use hinge or threshold features because the number of predictors is not estimated correctly.
Warren, D. L., Glor, R. E. and Turelli, M. 2009. ENMTools: a toolbox for comparative studies of environmental niche models. Ecography 33:607-611
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(dismo)
fnames <- list.files(path=file.path(system.file(package='dismo'), 'ex'),
patt='grd', full=TRUE )
predictors <- stack(fnames)
occ <- read.csv(file.path(system.file(package="dismo"), 'ex/bradypus.csv'))[, -1]
me <- maxent(predictors, occ, args=c('hinge=false', 'threshold=false'),
path=tempdir())
r <- project_maxent(me, predictors, quiet=TRUE)$prediction_raw
# passing the raster object to pred.raw and the maxent object to lambdas:
maxent_IC(r, occ, me)
# passing a lambdas file path to lambdas:
maxent_IC(r, occ, file.path(tempdir(), 'species.lambdas'))
# passing a raster file path and lambdas file path to lambdas:
writeRaster(r, f <- tempfile(fileext='.tif'))
maxent_IC(f, occ, file.path(tempdir(), 'species.lambdas'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.