| ts_lagmap | R Documentation |
Configure how a sliding-window predictor chooses the input_size lagged
attributes that will be fed to the underlying regression model.
ts_lagmap(
method = c("recent", "even", "geom", "acf", "pacf", "peaks", "seasonal",
"acf_seasonal", "pacf_seasonal", "blocks", "mi", "mrmr"),
seasonality = NULL,
peak_basis = c("acf", "pacf"),
block_radius = 1,
bins = 8
)
method |
Character. Lag-selection strategy:
|
seasonality |
Optional integer. Seasonal period used by the seasonal
lag selectors. If |
peak_basis |
Character. Correlation profile used by |
block_radius |
Integer. Radius around each selected center when
|
bins |
Integer. Number of quantile bins used by the mutual-information criteria. |
The lag mapper is fitted on the training data before the base predictor is
trained. During fit(), the mapper stores a vector of selected lag columns.
The default "recent" method reproduces the historical behavior of the
package: it keeps the most recent input_size observations available in the
sliding window.
Correlation-based methods operate on the raw training series reconstructed
from the input windows and aligned outputs. Supervised methods ("mi" and
"mrmr") inspect the relationship between each lagged attribute and the
training target.
A ts_lagmap object.
Box GEP, Jenkins GM, Reinsel GC, Ljung GM (2015). Time Series Analysis: Forecasting and Control. Fifth Edition. Wiley.
Peng H, Long F, Ding C (2005). Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Transactions on Pattern Analysis and Machine Intelligence, 27(8), 1226-1238. doi:10.1109/TPAMI.2005.159
Leites J, Cerqueira V, Soares C (2024). Selecting time lags for time series forecasting: an empirical study. arXiv:2405.11237.
library(daltoolbox)
library(tspredit)
data(tsd)
ts <- ts_data(tsd$y, 10)
io <- ts_projection(ts)
mapper <- ts_lagmap(method = "pacf")
mapper <- fit(mapper, io$input, io$output, input_size = 4)
mapper$lags
mapper$columns
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.