fit_maxnet: Fit a maxnet model

View source: R/fit_maxnet.R

fit_maxnetR Documentation

Fit a maxnet model

Description

A wrapper around the function maxnet in the maxnet package to suit the workflow I prefer for fitting MaxEnt models to a set of taxa and tuning models across a spectrum of spatial thinning and regularisation parameter values

Usage

fit_maxnet(
  taxonName = NULL,
  replTag = NULL,
  regTag = paste0("reg_", gsub(".", "_", regMult, fixed = TRUE)),
  baseOutputPath = NULL,
  predVar,
  envData,
  featureTypes = "lpq",
  regMult = 1,
  outputType = "link",
  createFolders = FALSE,
  quiet = TRUE
)

Arguments

taxonName

Taxonomic name associated with the model

replTag

String of characters identifying a replicate model fit

regTag

String of characters representing the identifiers for regularisation values to be used. Default is prefix "reg_" added to the numeric value(s) of the regularisation values passed in the parameter regMult.

baseOutputPath

Character string indicating the file system path used as a base for model fit output. The taxonomic name will be used to create a sub-folder under this base path when createFolders is TRUE and used to prefix the output filename always.

predVar

An array of integers representing the predicted variable, and corresponding to rows in envData, showing to which class each row belongs: 1 indicates presence or occupied cell, and 0 shows unoccupied background cell.

envData

A numeric matrix of environmental covariates or predictor variables to be considered in the model fit

featureTypes

Character value indicating the list of feature types to be used of the model fit. Default is 'lpq' meaning that linear, product and quadratic features will be used. Other options are available (see maxnet and MaxEnt documentation/literature) but not encouraged for ENMs as they lead to serious overfitting.

regMult

A numeric array of regularisation values to be used. A single numeric value maybe passed leading to just one fitted model at that regularisation value. More than one value will gerenate a sequence of fitted models, one for each regularisation value in the array.

outputType

Character. Output scaling of fitted model: "link" is raw linear predictor scores, while "exponential", "logistic" and "cloglog" generate a non-linear re-scaling of the raw linear predictor scores. See maxnet for further information.

createFolders

Logical. Should the function create sub-folders below baseOutPath using taxon name, replicate number and regularisation values? If FALSE (default) then replTag and regTag are ignored

quiet

Logical. Should the function proceed without emitting messages?

Value

A maxnet object


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