This function computes horizon-specific nonconformity scores by performing rolling-origin evaluation with recursive multi-step forecasting. This ensures proper out-of-sample calibration that respects the exchangeability assumption required for valid conformal prediction intervals.
calibrate_horizon_scores(
y,
y_modified,
max_lag,
caret_method,
seasonal,
K,
lambda,
pre_process,
tune_grid,
xreg = NULL,
calibration_horizon,
n_windows = NULL,
initial_window = NULL,
verbose = FALSE
)A list with horizon-indexed vectors of sorted absolute errors
Original time series (untransformed)
Transformed time series (Box-Cox if applicable)
Maximum lag used in the model
The caret method name
Logical, whether seasonal terms are used
Fourier order for seasonality
Box-Cox transformation parameter
Pre-processing specification
Tuning grid (uses best parameters from initial fit)
External regressors matrix (optional)
Maximum forecast horizon for calibration
Number of rolling windows for calibration
Initial training window size for calibration
Logical, print progress