blockedCV {PointedSDMs} | R Documentation |
blockedCV: run spatial blocked cross-validation on the integrated model.
Description
This function is used to perform spatial blocked cross-validation with regards to model selection for the integrated model. It does so by leaving out a block of data in the full model, running a model with the remaining data, and then calculating the deviance information criteria (DIC) as a score of model fit.
Usage
blockedCV(
data,
options = list(),
method = "DIC",
predictName = NULL,
datasetCombs = NULL
)
Arguments
data |
An object produced by either |
options |
A list of INLA or inlabru options to be used in the model. Defaults to |
method |
Which cross-validation method to perform. Must be one of |
predictName |
Name of the dataset to predict onto if |
datasetCombs |
A list of vectors containing dataset combinations to include in each model run if |
Value
An object of class blockedCV
, which is essentially a list of DIC values obtained from each iteration of the model.
Examples
## Not run:
if(requireNamespace('INLA')) {
#Get Data
data("SolitaryTinamou")
proj <- "+proj=longlat +ellps=WGS84"
data <- SolitaryTinamou$datasets
mesh <- SolitaryTinamou$mesh
mesh$crs <- proj
#Set model up
organizedData <- startISDM(data, Mesh = mesh,
responsePA = 'Present',
Projection = proj)
#Set up spatial block
organizedData$spatialBlock(k = 2, rows = 2, cols = 1)
#Run spatial block cross-validation
blocked <- blockedCV(organizedData)
#Print summary
blocked
}
## End(Not run)