Creates prediction intervals by bootstrapping from historical forecast errors. This is a non-parametric method that doesn't assume any particular distribution.
EmpiricalInterval(
n_trajectories = 1000L,
min_observation = 1L,
bootstrap_distribution = NULL,
seed = NULL,
positivity_correction = "none",
symmetry_correction = FALSE,
stepwise = FALSE,
return_trajectories = FALSE
)Number of bootstrap samples to generate (default: 1000)
Minimum number of observations required (default: 1)
Optional distribution to sample from (default: NULL)
Random seed for reproducibility (default: NULL)
Method to ensure positive forecasts: "none", "post_clip", "truncate", or "zero_floor" (default: "none")
Whether to apply symmetry correction (default: FALSE)
Whether to use stepwise intervals (default: FALSE)
Whether to return forecast trajectories (default: FALSE)
An EmpiricalInterval object
if (FALSE) { # \dontrun{
# Basic empirical intervals
method <- EmpiricalInterval()
# With more trajectories and seed
method <- EmpiricalInterval(n_trajectories = 2000, seed = 123)
# With positivity correction for count data
method <- EmpiricalInterval(
n_trajectories = 1000,
positivity_correction = "post_clip"
)
# Return trajectories for visualization
method <- EmpiricalInterval(return_trajectories = TRUE)
} # }