Compute exact Shapley values for an ahead::dynrmf model

dynrmf_shap(
  y,
  xreg_fit,
  xreg_predict,
  fit_func = ahead::ridge,
  verbose = TRUE,
  tol = 1e-10
)

Arguments

y

Training time series (passed to ahead::dynrmf as y)

xreg_fit

Regressor matrix used during training

xreg_predict

Regressor matrix for the forecast horizon (h x p); h and feature names are derived from this matrix.

fit_func

Fitting function for ahead::dynrmf (default: ahead::ridge)

verbose

Print progress per horizon and efficiency check (default: TRUE)

tol

Tolerance for the efficiency-axiom check (default: 1e-10)

Value

A list of class "dynrmf_shap" with: $S : h x p matrix of Shapley values (per variable, per horizon) $X : test regressor matrix $baseline : scalar baseline (mean of empty-coalition forecasts) $baselines : per-horizon baseline forecasts $predictions : per-horizon full-coalition forecasts $feature_names $h