ecospat.boyce: Calculate Boyce Index

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ecospat.boyce.R

Description

Calculate the Boyce index as in Hirzel et al. (2006). The Boyce index is used to assess model performance.

Usage

1
ecospat.boyce (fit, obs, nclass=0, window.w="default", res=100, PEplot = TRUE)

Arguments

fit

A vector or Raster-Layer containing the predicted suitability values

obs

A vector containing the predicted suitability values or xy-coordinates (if "fit" is a Raster-Layer) of the validation points (presence records)

nclass

The number of classes or vector with class thresholds. If nclass=0, the Boyce index is calculated with a moving window (see next parameters)

window.w

The width of the moving window (by default 1/10 of the suitability range)

res

The resolution of the moving window (by default 100 focals)

PEplot

If true, plot the predicted to expected ratio along the suitability class

Details

The Boyce index only requires presences and measures how much model predictions differ from random distribution of the observed presences across the prediction gradients (Boyce et al. 2002). It is thus the most appropriate metric in the case of presence-only models. It is continuous and varies between -1 and +1. Positive values indicate a model which present predictions are consistent with the distribution of presences in the evaluation dataset, values close to zero mean that the model is not different from a random model, negative values indicate counter predictions, i.e., predicting poor quality areas where presences are more frequent (Hirzel et al. 2006).

Value

The function returns a list that contains a vector F.ratio (the predicted-to-expected ratio for each class-interval) and a numeric Spearman.cor (the Boyce index value)

Author(s)

Blaise Petitpierre bpetitpierre@gmail.com and Frank Breiner frank.breiner@unil.ch

References

Boyce, M.S., P.R. Vernier, S.E. Nielsen and F.K.A. Schmiegelow. 2002. Evaluating resource selection functions. Ecol. Model., 157, 281-300.

Hirzel, A.H., G. Le Lay, V. Helfer, C. Randin and A. Guisan. 2006. Evaluating the ability of habitat suitability models to predict species presences. Ecol. Model., 199, 142-152.

Examples

1
2
3
4
5
obs <- (ecospat.testData$glm_Saxifraga_oppositifolia
[which(ecospat.testData$Saxifraga_oppositifolia==1)])

ecospat.boyce (fit = ecospat.testData$glm_Saxifraga_oppositifolia , obs, nclass=0, 
window.w="default", res=100, PEplot = TRUE)

Example output

Loading required package: ade4
Loading required package: ape
Loading required package: gbm
Loading required package: survival
Loading required package: lattice
Loading required package: splines
Loading required package: parallel
Loaded gbm 2.1.3
Loading required package: sp
$F.ratio
 [1]  0.1457490  0.5454545  0.8181818  1.2972973  1.6000000  1.2857143
 [7]  1.3846154  1.6363636  1.2631579  1.3333333  1.4117647  1.4117647
[13]  1.7142857  1.7142857  1.0909091  1.2000000  1.0909091  2.0000000
[19]  1.8461538  1.0909091  1.2000000  1.5000000  1.5000000  1.7142857
[25]  2.6666667  3.4285714  3.4285714  6.0000000  4.0000000  3.0000000
[31]  6.0000000  6.0000000  4.8000000  4.8000000  4.8000000  6.0000000
[37]  6.0000000  6.0000000  4.8000000  4.0000000  4.0000000  2.0000000
[43]  3.0000000  3.4285714  4.5000000  4.5000000  3.4285714  3.4285714
[49]  4.5000000  5.1428571  6.0000000  7.2000000  9.0000000  8.0000000
[55] 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000
[61] 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000
[67] 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000
[73] 12.0000000 12.0000000 12.0000000 12.0000000 12.0000000  8.0000000
[79]  8.0000000  6.0000000  6.0000000  6.0000000  8.0000000  6.0000000
[85]  7.2000000  7.2000000  7.2000000  7.2000000  9.0000000  9.0000000
[91]  9.6000000 10.2857143 10.0000000 10.0000000 10.0000000

$Spearman.cor
[1] 0.91

$HS
 [1] 0.0490350 0.0578613 0.0666876 0.0755139 0.0843402 0.0931665 0.1019928
 [8] 0.1108191 0.1196454 0.1284717 0.1372980 0.1461243 0.1549506 0.1637769
[15] 0.1726032 0.1814295 0.1902558 0.1990821 0.2079084 0.2167347 0.2255610
[22] 0.2343873 0.2432136 0.2520399 0.2608662 0.2696925 0.2785188 0.2873451
[29] 0.2961714 0.3049977 0.3138240 0.3226503 0.3314766 0.3403029 0.3491292
[36] 0.3579555 0.3667818 0.3756081 0.3844344 0.3932607 0.4020870 0.4109133
[43] 0.4197396 0.4285659 0.4373922 0.4462185 0.4550448 0.4638711 0.4726974
[50] 0.4815237 0.4903500 0.4991763 0.5080026 0.5168289 0.5256552 0.5344815
[57] 0.5433078 0.5521341 0.5609604 0.5697867 0.6227445 0.6315708 0.6403971
[64] 0.6492234 0.6580497 0.6668760 0.6757023 0.6845286 0.6933549 0.7021812
[71] 0.7110075 0.7198338 0.7286601 0.7374864 0.7463127 0.7551390 0.7639653
[78] 0.7727916 0.7816179 0.7904442 0.7992705 0.8080968 0.8169231 0.8257494
[85] 0.8345757 0.8434020 0.8522283 0.8610546 0.8698809 0.8787072 0.8875335
[92] 0.8963598 0.9051861 0.9140124 0.9228387

ecospat documentation built on Feb. 19, 2021, 5:07 p.m.