
Output summary statistics for a MaxEnt model ('SDMmodelCV' object)
Source:R/compute_MaxEnt_summary_statistics_CV.R
compute_MaxEnt_summary_statistics_CV.Rd
This function will create a directory for and save a MaxEnt model that was run
using the SDMtune
R package. It will use the model to calculate a list of
summary statistics based on the test data and covariates given. See 'return'
for a list of summary statistics outputs.
Usage
compute_MaxEnt_summary_statistics_CV(
model.obj,
model.name = "MODEL",
mypath,
create.dir = FALSE,
env.covar.obj,
train.obj,
trainFolds.obj,
test.obj,
plot.fun = "mean",
plot.type = "cloglog",
jk.test.type = "test"
)
Arguments
- model.obj
A model object created by the package 'SDMtune', should be of class 'SDMmodelCV'.
- model.name
Character. A string matching the name of the object set for
model.obj
. Exclude unnecessary phrases, such as the "_model" ending.- mypath
Character.A file path to the sub directory where the model output will be stored. Should be used with the
file.path()
function (i.e. with '/' instead of '\'). If this sub directory does not already exist and should be created by the function, setcreate.dir
= TRUE. This will create a folder from the last part of the filepath inmypath
.- create.dir
Logical. Should the last element of
mypath
create a sub directory for the model output? If TRUE, the main folder will be created for the model output. If FALSE (ie, the sub directory already exists), only the "plots" folder within the model output sub directory will be created.- env.covar.obj
A stack of rasters of environmental covariates. These covariates are used to train and test the MaxEnt model, as well as to make predictions. These should be the same covariates that you used to train the model. This must a
SpatRaster
object created usingterra::rast()
.- train.obj
The main group of presence and background points used to train the model. Should be a SWD object, created using the
SDMtune::prepareSWD()
function.- trainFolds.obj
A list of two matrices that specify the fold of the training and testing points. This object is used to create k-fold partitions from presence and background datasets to train a
SWDmodelCV
object. This is created using theSDMtune::randomFolds()
function.- test.obj
A withheld group of presence and background points used to test the model after training. Should be a SWD object, created using the
SDMtune::prepareSWD()
function.- plot.fun
Character. Default is "mean". The function used to determine the level of the other variables when creating the marginal curve. Can be one of:
min
,mean
,median
,max
, orsd
(standard deviation).- plot.type
Character. Default is "cloglog".The type of output desired for the marginal and univariate response curves. Choices are "logistic" and "cloglog".If both are used, must be concatenated in the form:
c("logistic", "cloglog")
.- jk.test.type
Character. Default is "test". When a jackknife test is conducted, this specifies whether to conduct the test on the training or the test dataset. Choices are one of both of "train" and "test". If both are used, must be concatenated in the form:
c("train", "test")
.
Value
The output of this function includes the following:
training and test datasets used for the model
listed model parameters and suitability thresholds
K-folds and which samples were included per fold
variable contributions, permutation importance and SD
confusion matrices per iteration
jackknife tests for both training and testing data, per iteration
jackknife plots
AUC / TSS
ROC plots
marginal and univariate response curves