ecospat (version 2.0)

ecospat.cv.glm: GLM Cross Validation

Description

K-fold and leave-one-out cross validation for GLM.

Usage

ecospat.cv.glm (glm.obj, K=10, cv.lim=10, jack.knife=F)

Arguments

glm.obj
Any calibrated GLM object with a binomial error distribution.
K
Number of folds. 10 is recommended; 5 for small data sets.
cv.lim
Minimum number of presences required to perform the K-fold cross-validation.
jack.knife
If TRUE, then the leave-one-out / jacknife cross-validation is performed instead of the 10-fold cross-validation.

Value

Details

This function takes a calibrated GLM object with a binomial error distribution and returns predictions from a stratified 10-fold cross-validation or a leave-one-out / jack-knived cross-validation. Stratified means that the original prevalence of the presences and absences in the full dataset is conserved in each fold.

References

Randin, C.F., T. Dirnbock, S. Dullinger, N.E. Zimmermann, M. Zappa and A. Guisan. 2006. Are niche-based species distribution models transferable in space? Journal of Biogeography, 33, 1689-1703.

Pearman, P.B., C.F. Randin, O. Broennimann, P. Vittoz, W.O. van der Knaap, R. Engler, G. Le Lay, N.E. Zimmermann and A. Guisan. 2008. Prediction of plant species distributions across six millennia. Ecology Letters, 11, 357-369.

Examples

Run this code
## Not run: 
# glm <- ecospat.cv.glm (glm.obj = get ("glm.Agrostis_capillaris", envir=ecospat.env), 
# K=10, cv.lim=10, jack.knife=FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab