sp_contig: Assign the locations of a regular grid to folds in contiguous...

Description Usage Arguments Value

View source: R/utils.R

Description

Assigns the locations of a data frame into contiguous blocks folds for cross-validation. Assumes the sites are sorted (e.g., left to right, bottom to top). WARNING: Works well for perfect squares that can be divided into nfolds perfect squares ONLY.

Usage

1
sp_contig(nfolds, nsites, grid.h = sqrt(nsites), grid.w = sqrt(nsites))

Arguments

nfolds

number of folds to divide the space into

nsites

number of locations in the regular grid

grid.h

height of the grid (in number of sites). Default is sqrt(nfolds)

grid.w

width of the grid (in number of sites). Default is sqrt(nfolds)

Value

a vector with the fold assignment of each location


mrfoliveira/Evaluation-procedures-for-forecasting-with-spatio-temporal-data documentation built on April 11, 2021, 10:50 a.m.