represampling_disc_bootstrap: Overlapping spatial block bootstrap using circular blocks

Description Usage Arguments Note Examples

View source: R/sperrorest_resampling.R

Description

represampling_disc_bootstrap performs a spatial block bootstrap by resampling at the level of rectangular partitions or 'tiles' generated by partition_tiles.

Usage

1
2
represampling_disc_bootstrap(data, coords = c("x", "y"), nboot,
  repetition = 1, seed1 = NULL, oob = FALSE, ...)

Arguments

data

data.frame containing at least the columns specified by coords

coords

vector of length 2 defining the variables in data that contain the x and y coordinates of sample locations.

nboot

number of bootstrap samples; you may specify different values for the training sample (nboot[1]) and for the test sample (nboot[2]).

repetition

numeric vector: cross-validation repetitions to be generated. Note that this is not the number of repetitions, but the indices of these repetitions. E.g., use repetition = c(1:100) to obtain (the 'first') 100 repetitions, and repetition = c(101:200) to obtain a different set of 100 repetitions.

seed1

seed1+i is the random seed that will be used by set.seed in repetition i (i in repetition) to initialize the random number generator before sampling from the data set.

oob

logical (default FALSE): if TRUE, use the out-of-bag sample as the test sample (the complement of the nboot[1] test set discs, minus the buffer area as specified in the ... arguments to partition_disc); if FALSE, draw a second bootstrap sample of size nboot independently to obtain a test sample (sets of overlapping discs drawn with replacement).

...

additional arguments to be passed to partition_disc; note that a buffer argument has not effect if oob=FALSE; see example below

Note

Performs nboot out of nrow(data) resampling of circular discs. This is an overlapping spatial block bootstrap where the blocks are circular.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(ecuador)
# Overlapping disc bootstrap:
parti <-  represampling_disc_bootstrap(ecuador, radius = 200, nboot = 20,
oob = FALSE)
# plot(parti, ecuador)
# Note that a 'buffer' argument would make no difference because boostrap
# sets of discs are drawn independently for the training and test sample.
#
# Overlapping disc bootstrap for training sample, out-of-bag sample as test
# sample:
parti <-  represampling_disc_bootstrap(ecuador, radius = 200, buffer = 200,
                                      nboot = 10, oob = TRUE)
# plot(parti,ecuador)

sperrorest documentation built on Nov. 17, 2017, 4:28 a.m.