Skip to contents

Often there is an intention to display not only the predictions made with a SDM, but also the uncertainty of the prediction. Uncertainty be estimated either directly by the model or by calculating the variation in prediction values among a set of models.

In particular Bayesian engines can produce not only mean estimates of fitted responses, but also pixel-based estimates of uncertainty from the posterior such as the standard deviation (SD) or the coefficient of variation of a given prediction.

This function makes use of the "biscale" R-package to create bivariate plots of the fitted distribution object, allowing to visualize two variables at once. It is mostly thought of as a convenience function to create such bivariate plots for quick visualization.

Supported Inputs are either single trained Bayesian DistributionModel with uncertainty or the output of an ensemble() call. In both cases, users have to make sure that "xvar" and "yvar" are set accordingly.

Usage

bivplot(
  mod,
  xvar = "mean",
  yvar = "sd",
  plot = TRUE,
  fname = NULL,
  title = NULL,
  col = "BlueGold",
  ...
)

# S4 method for class 'ANY'
bivplot(
  mod,
  xvar = "mean",
  yvar = "sd",
  plot = TRUE,
  fname = NULL,
  title = NULL,
  col = "BlueGold",
  ...
)

Arguments

mod

A trained DistributionModel or alternatively a SpatRaster object with prediction model within.

xvar

A character denoting the value on the x-axis (Default: 'mean').

yvar

A character denoting the value on the y-axis (Default: 'sd').

plot

A logical indication of whether the result is to be plotted (Default: TRUE)?

fname

A character specifying the output filename a created figure should be written to.

title

Allows to respecify the title through a character (Default:NULL).

col

A character stating the colour palette to use. Has to be either a predefined value or a vector of colours. See "biscale::bi_pal_manual". Default: "BlueGold".

...

Other engine specific parameters.

Value

Saved bivariate plot in 'fname' if specified, otherwise plot.

Note

This function requires the biscale package to be installed. Although a work around without the package could be developed, it was not deemed necessary at this point. See also this gist.