pROC {tenm}R Documentation

Partial ROC calculation for Niche Models

Description

Apply partial ROC tests to continuous niche models.

Usage

pROC(
  continuous_mod,
  test_data,
  n_iter = 1000,
  E_percent = 5,
  boost_percent = 50,
  rseed = FALSE,
  sub_sample = TRUE,
  sub_sample_size = 1000
)

Arguments

continuous_mod

A SpatRaster or 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 numeric vector:

  • If data.frame or matrix, it should contain coordinates of the occurrences used to test the ecological niche model. Columns must be: longitude and latitude.

  • If numeric vector, it should contain the values of the predicted suitability.

n_iter

Number of bootstrap iterations to perform for partial ROC calculations. Default is 1000.

E_percent

Numeric value from 0 to 100 used as the threshold (E) for partial ROC calculations. Default is 5.

boost_percent

Numeric value from 0 to 100 representing the percentage of testing data to use for bootstrap iterations in partial ROC. Default is 50.

rseed

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

sub_sample

Logical. Indicates whether to use a subsample of the test data. Recommended for large datasets.

sub_sample_size

Size of the subsample to use for computing pROC values when sub_sample is TRUE.

Details

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

Value

A list of two elements:

References

Peterson, A.T. et al. (2008) Rethinking receiver operating characteristic analysis applications in ecological niche modeling. Ecol. Modell., 213, 63–72. doi:10.1016/j.ecolmodel.2007.11.008

Examples

data(abronia)
suit_1970_2000 <- terra::rast(system.file("extdata/suit_1970_2000.tif",
                                          package = "tenm"))
print(suit_1970_2000)
proc_test <- tenm::pROC(continuous_mod = suit_1970_2000,
                        test_data = abronia[,c("decimalLongitude",
                                               "decimalLatitude")],
                        n_iter = 500, E_percent=5,
                        boost_percent=50)
print(proc_test$pROC_summary)


[Package tenm version 0.5.1 Index]