make_bootstrap_pools: Make pools for block bootstrapping

View source: R/bootstrap_pools.R

make_bootstrap_poolsR Documentation

Make pools for block bootstrapping

Description

For doing a block bootstrap using bootstrap_verify, the blocks can be passed as a data frame with a "pool" column telling bootstrap_verify how to pool the data into blocks. make_bootstrap_pools is a function to make such a data frame.

Usage

make_bootstrap_pools(.fcst, pool_col, pool_length, overlap = FALSE)

Arguments

.fcst

A harp_fcst object

pool_col

The column used to define the pools. Must be unquoted.

pool_length

The length of a pool. Numeric or a character with a unit qualifier if pool_col is in date-time format. The unit qualifier can be : "s" = seconds, "m" = minutes, "h" = hours, "d" = days.

overlap

Logical. Whether the pools should overlap.

Details

Typically block bootstrapping would be used if there are serial auto-correlations in the data. If for example auto-correlations are suspected between forecasts, pools could be defined from the fcdate column to create blocks of data where those auto-correlations are maintained.

Pools may be set to overlap, whereby a new pool is created beginning at each new value in pool_col. The length of a pool should be defined in the units used in pool_col - if pool_col is a date-time column, then pool_length is assumed to be in hours, though the units can be set by adding a qualifier letter: "s" = seconds, "m" = minutes, "h" = hours, "d" = days.

Value

A data frame with columns from pool_col and "pool".


andrew-MET/harpPoint documentation built on Feb. 23, 2023, 1:06 a.m.