project | R Documentation |
Project a fitted Maxent model by predicting to new environmental data.
project(lambdas, newdata, return_lfx = FALSE, mask, quiet = FALSE)
lambdas |
Either (1) a |
newdata |
A |
return_lfx |
Logical. Should |
mask |
(Optional; requires that |
quiet |
Logical. Should projection progress be reported? |
project
uses feature weights described in a .lambas
file or MaxEnt
object to predict a Maxent model to environmental
data. This function performs the projection entirely in R, without the need
for the Maxent Java software. For tested datasets, it performs the
projection in roughly one third of the time taken for the same projection
by maxent.jar.
If newdata
is a RasterStack
or RasterBrick
, a
list with three elements:
prediction_raw
: a Raster
layer giving the raw Maxent
prediction;
prediction_logistic
: a Raster
layer giving the
logistic Maxent prediction; and
prediction_cloglog
: a Raster
layer giving the
cloglog Maxent prediction.
If newdata
is not a RasterStack
or RasterBrick
,
the raster layers will be replaced with data.table
s in the returned
list.
Additionally, if newdata
is a RasterStack
or RasterBrick
and return_lfx
is TRUE
, the returned list will include
prediction_lfx
(the logit scores for the linear predictor), and
lfx_all
(the contributions to prediction_lfx
of each feature
with a non-zero lambda).
This function is still in development, and no guarantee is made for the accuracy of its projections.
Wilson, P. W. (2009) Guidelines for computing MaxEnt model output values from a lambdas file.
Maxent software for species habitat modeling, version 3.3.3k help file (software freely available here).
read_mxe()
## Not run:
# Below we use the dismo::maxent example to fit a Maxent model:
fnames <- list.files(system.file('ex', package='dismo'), '\\.grd$',
full.names=TRUE )
predictors <- stack(fnames)
occurrence <- system.file('ex/bradypus.csv', package='dismo')
occ <- read.table(occurrence, header=TRUE, sep=',')[,-1]
me <- maxent(predictors, occ, factors='biome')
# ... and then predict it to the full environmental grids:
pred <- project(me, predictors)
# This is equivalent to using the predict method for MaxEnt objects:
pred2 <- predict(me, predictors, args='outputformat=logistic')
pred3 <- predict(me, predictors, args='outputformat=cloglog')
all.equal(values(pred$prediction_logistic), values(pred2))
all.equal(values(pred$prediction_cloglog), values(pred3))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.