blockSample: blockSample

Description Usage Arguments Value Examples

View source: R/wBTCode.R

Description

Get a bootstrap replicate of the Sample data frame based on the user-specified blockLength. The bootstrap replicate is made up randomly selected blocks of data from Sample data frame. Each block includes all the samples in a standard period of time (the blockLength measured in days). The blocks are created based on the random selection (with replacement) of starting dates from the full Sample data frame. The bootstrap replicate has the same number of observations as the original Sample, but some observations are included once, some are included multiple times, and some are not included at all.

Usage

1
blockSample(localSample, blockLength, startSeed = NA)

Arguments

localSample

Sample data frame

blockLength

integer size of subset, expressed in days. 200 days has been found to be a good choice.

startSeed

setSeed value. This is used to make repeatable output. Default = NA.

Value

newSample data frame in same format as Sample data frame. It has the same number of rows as the Sample data frame.

Examples

1
2
3
4
library(EGRET)
eList <- Choptank_eList
Sample <- eList$Sample
bsReturn <- blockSample(Sample, 200)

EGRETci documentation built on April 13, 2021, 5:08 p.m.