varImportance: Variable importance for a maxnet model

View source: R/varImportance.R

varImportanceR Documentation

Variable importance for a maxnet model

Description

Computes variable importance scores for all variables present in a maxnet model object. Scores are indicative and should be interpreted with caution as variable interaction is not considered in the computation of the scores.

Usage

varImportance(
  theModel,
  occSWD = NULL,
  bkgSWD = NULL,
  responseType = c("link", "exponential", "cloglog", "logistic"),
  numReplicates = 5
)

Arguments

theModel

Object of class maxnet

occSWD

Data.frame. Environmental data at occurrence locations in SWD format.

bkgSWD

Data.frame. Background environmental data in SWD format.

responseType

Character. A MaxEnt response scale; one of "link", "exponential", "logistic" or "cloglog".

numReplicates

Integer. Number of permutations performed to compute importance.

Details

The method used to compute variable importance follows that used in R packages biomod2 and ecospat. First, model predictions are made for each row of the combined environmental data table formed by stacking occSWD and bkgSWD. This is the reference or full-model result.

For each variable in the maxnet model object, values for the variable are permuted between rows and a model prediction made for each row using the permuted or shuffled data table. The permutation is performed numReplicates times for each variable.

At each permutation, a Pearson correlation is computed between reference predictions and the predicted values from the shuffled table. The importance score is 1 - correlation coefficient.

A vector of mean scores for each variable expressed as a percentage of the sum of all mean scores is returned.

Value

A named vector of percent importance scores for the variables present in the maxnet model object sorted from highest to lowest.


peterbat1/fitMaxnet documentation built on Sept. 17, 2024, 10:50 p.m.