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_partial(
  ...,
  x.var,
  method = "mean",
  layer = "mean",
  newdata = NULL,
  normalize = TRUE
)

# S4 method for ANY
ensemble_partial(
  ...,
  x.var,
  method = "mean",
  layer = "mean",
  newdata = 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.

normalize

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

Value

A data.frame 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) {
 # Assumes previously computed models
 ex <- ensemble_partial(mod1, mod2, mod3, method = "mean")
}