pROC: Partial ROC calculation for Niche Models

View source: R/pROC.R

pROCR Documentation

Partial ROC calculation for Niche Models

Description

pROC applies partial ROC tests to continuous niche models.

Usage

pROC(
  continuous_mod,
  test_data,
  n_iter = 1000,
  E_percent = 5,
  boost_percent = 50,
  parallel = FALSE,
  ncores = 4,
  rseed = FALSE,
  sub_sample = FALSE,
  sub_sample_size = 10000
)

Arguments

continuous_mod

a RasterLayer or a numeric vector of the ecological niche model to be evaluated. If a numeric vector is provided it should contain the values of the predicted suitability.

test_data

A numerical matrix, data.frame, or a numeric vector. If it is data.frame or matrix it should contain coordinates of the occurrences used to test the ecological niche model to be evaluated; columns must be: longitude and latitude. If numeric vector it should contain the values of the predicted suitability.

n_iter

(numeric) number of bootstrap iterations to be performed; default = 1000.

E_percent

(numeric) value from 0 to 100 that will be used as a threshold (E); default = 5.

boost_percent

(numeric) value from 0 to 100 representing the percent of testing data to be used for performing the bootstrap process for calculating the partial ROC; default = 50.

parallel

Logical to specify if the computation will be done in parallel. default=TRUE.

ncores

Numeric; the number of cores to be used for parallelization.

rseed

Logical. Whether or not to set a random seed. Default FALSE.

sub_sample

Logical. Indicates whether the test should run using a subsample of size sub_sample_size. It is recommended for big rasters

sub_sample_size

Numeric. Size of the sample to be used for computing pROC values.

Details

Partial ROC is calculated following Peterson et al. (2008; http://dx.doi.org/10.1016/j.ecolmodel.2007.11.008). This function is a modification of the PartialROC funcion, available at https://github.com/narayanibarve/ENMGadgets.

Value

A data.frame containing the AUC values and AUC ratios calculated for each iteration.

References

Peterson, A.T. et al. (2008) Rethinking receiver operating characteristic analysis applications in ecological niche modeling. Ecol. Modell., 213, 63–72.

Examples

# Load a continuous model
conti_model <- raster::raster(system.file("extdata",
                                          "ambystoma_model.tif",
                                           package="ntbox"))
# Read validation (test) data
test_data <- read.csv(system.file("extdata",
                                  "ambystoma_validation.csv",
                                  package = "ntbox"))

# Filter only presences as the Partial ROC only needs occurrence data
test_data <- dplyr::filter(test_data, presence_absence==1)
test_data <- test_data[,c("longitude","latitude")]

partial_roc <- pROC(continuous_mod=conti_model,
                    test_data = test_data,
                    n_iter=1000,E_percent=5,
                    boost_percent=50,
                    parallel=FALSE)


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