Compare paired prediction errors with a year-block bootstrap

Description

Resamples consecutive circular blocks of years, retaining all regions in each sampled year. The interval describes uncertainty in a paired RMSE difference on the supplied evaluation period; it is not a guarantee under nonstationarity. Few observed years give weak uncertainty estimates.

Usage

compare_crop_errors(
  predictions,
  reference,
  repetitions = 2000L,
  block_length = 2L,
  confidence = 0.95,
  seed = 2718L
)

Arguments

predictions

Data frame with 'Method', 'RS', 'Year', 'Observed', and 'Predicted'. Each method must have the same region/year observations.

reference

Reference method name.

repetitions

Number of bootstrap resamples, at least 100.

block_length

Number of consecutive years per block.

confidence

Confidence level between zero and one.

seed

Integer random seed; the caller's random state is preserved.

Value

A data frame with paired RMSE differences (method minus reference), percentile limits, observation/year counts, and bootstrap settings.

Examples

p <- expand.grid(RS = c("A", "B"), Year = 2001:2008,
                 Method = c("reference", "alternative"))
p$Observed <- 10 + p$Year - 2000
p$Predicted <- p$Observed + ifelse(p$Method == "reference", 2, 1)
compare_crop_errors(p, "reference", repetitions = 100)

[Package yieldlag version 0.3.0 ]