contextridge2f.RdThis function performs ridge regression forecasting using attention-based context vectors as external regressors. Context vectors are computed from the training data using various attention mechanisms and then used to enhance the forecast model.
contextridge2f(
y,
h = 5L,
attention_type = "exponential",
window_size = 3,
decay_factor = 5,
temperature = 1,
sigma = 1,
sensitivity = 1,
alpha = 0.5,
beta = 0.5,
...
)A multivariate time series object.
Integer. Forecast horizon. Defaults to 5.
String specifying the type of attention mechanism. Options are: "cosine", "exponential", "dot_product", "scaled_dot_product", "gaussian", "linear", "value_based", "hybrid", "parametric". Default is "exponential".
Integer parameter for window size (applicable for "cosine" attention). Defaults to 3.
Double for decay factor (applicable for "exponential" and "hybrid" attention). Defaults to 5.0.
Double for temperature (applicable for "scaled_dot_product" attention). Defaults to 1.0.
Double for sigma (applicable for "gaussian" attention). Defaults to 1.0.
Double for sensitivity (applicable for "value_based" or "hybrid" attention). Defaults to 1.0.
Double for alpha (applicable for "parametric" attention). Defaults to 0.5.
Double for beta (applicable for "parametric" attention). Defaults to 0.5.
Additional arguments passed to ahead::ridge2f
(e.g., lags, lambda_1, lambda_2, nb_hidden, etc.).
An object returned by ahead::ridge2f for the forecast,
typically a list including mean and prediction intervals.
This approach allows the model to leverage temporal dependencies captured by attention mechanisms, potentially improving forecast accuracy by incorporating weighted historical information.