mop: MOP: Extrapolation risk analysis for model transfer

View source: R/mop.R

mopR Documentation

MOP: Extrapolation risk analysis for model transfer

Description

mop calculates a Mobility-Oriented Parity

Usage

mop(
  M_stack,
  G_stack,
  percent = 10,
  comp_each = 2000,
  parallel = FALSE,
  normalized = TRUE,
  ncores = 4
)

Arguments

M_stack

a RasterStack of variables representing the calibration area (M area in ENM context).

G_stack

a RasterStack of variables representing areas or scenarios to which models will be transferred.

percent

(numeric) percent of values sampled from the calibration region to calculate the MOP.

comp_each

(numeric) compute distance matrix for a each fixed number of rows (default = 2000).

parallel

(logical) if TRUE, calculations will be performed in parallel using the available cores of the computer. This will demand more RAM and almost full use of the CPU; hence, its use is more recommended in high-performance computers. Using this option will speed up the analyses. Default = FALSE

normalized

(logical) if TRUE mop output will be normalized to 1.

ncores

(numeric) Number of cores to be used if the process is going to be run in parallel

Details

The MOP is calculated following Owens et al. (2013; https://doi.org/10.1016/j.ecolmodel.2013.04.011). This function is a modification of the MOP function, available at https://github.com/narayanibarve/ENMGadgets.The value of the comp_each parameter depends on the RAM memory available for the process; the computation can be faster if the user chooses a bigger value for this parameter but you have to be careful on memory use.

Value

A mobility-oriented parity RasterLayer where values of 0 represent strict extrapolation, which means complete dissimilarity of environments between the calibration (M) and projection area (G).

Examples

## Not run: 
m_stack <- raster::stack(list.files(system.file("extdata",
                                                package = "ntbox"),
                                    pattern = "M_layers.tif$",
                                    full.names = TRUE))
g_stack <- raster::stack(list.files(system.file("extdata",
                                                package = "ntbox"),
                                    pattern = "G_layers.tif$",
                                    full.names = TRUE))

mop_res <- ntbox::mop(M_stack = m_stack,
                      G_stack = g_stack, percent = 10,
                      comp_each=2000)
raster::plot(mop_res)

## End(Not run)

luismurao/ntbox documentation built on May 9, 2024, 8:24 p.m.