Skip to contents

Similar to the ensemble() function, this function creates an ensemble of partial responses of provided distribution models fitted with the ibis.iSDM-package. Through the layer parameter it can be specified which part of the partial prediction should be averaged in an ensemble (if given). This can be for instance the mean prediction and/or the standard deviation sd. Ensemble partial is also being called if more than one input DistributionModel object is provided to partial.

By default the ensemble of partial responses is created as average across all models with the uncertainty being the standard deviation of responses.

Usage

ensemble_spartial(
  ...,
  x.var,
  method = "mean",
  layer = "mean",
  newdata = NULL,
  min.value = NULL,
  normalize = TRUE
)

# S4 method for class 'ANY'
ensemble_spartial(
  ...,
  x.var,
  method = "mean",
  layer = "mean",
  newdata = NULL,
  min.value = NULL,
  normalize = TRUE
)

Arguments

...

Provided DistributionModel objects from which partial responses can be called. In the future provided data.frames might be supported as well.

x.var

A character of the variable from which an ensemble is to be created.

method

Approach on how the ensemble is to be created. See details for options (Default: 'mean').

layer

A character of the layer to be taken from each prediction (Default: 'mean'). If set to NULL ignore any of the layer names in ensembles of SpatRaster objects.

newdata

A optional data.frame or SpatRaster object supplied to the model (DefaultL NULL). This object needs to have identical names as the original predictors.

min.value

A optional numeric stating a minimum value that needs to be surpassed in each layer before calculating and ensemble (Default: NULL).

normalize

logical on whether the inputs of the ensemble should be normalized to a scale of 0-1 (Default: TRUE).

Value

A SpatRaster object with the combined partial effects of the supplied models.

Details

Possible options for creating an ensemble includes:

  • 'mean' - Calculates the mean of several predictions.

  • 'median' - Calculates the median of several predictions.

Note

If a list is supplied, then it is assumed that each entry in the list is a fitted DistributionModel object. Take care not to create an ensemble of models constructed with different link functions, e.g. logistic vs log. By default the response functions of each model are normalized.

Examples

if (FALSE) { # \dontrun{
 # Assumes previously computed models
 ex <- ensemble_spartial(mod1, mod2, mod3, method = "mean")
} # }