Type: | Package |
Title: | Dynamic Mode Decomposition Forecasting with Conformal Predictive Sampling |
Version: | 2.0.0 |
Description: | The DYMO package provides tools for multi-feature time-series forecasting using a Dynamic Mode Decomposition (DMD) model combined with conformal predictive sampling for uncertainty quantification. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.3 |
Imports: | ggplot2 (≥ 4.0.0), rlang (≥ 1.1.6) |
URL: | https://rpubs.com/giancarlo_vercellino/dymo |
Suggests: | knitr, testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
Depends: | R (≥ 4.5.0) |
NeedsCompilation: | no |
Packaged: | 2025-10-06 20:26:22 UTC; gianc |
Author: | Giancarlo Vercellino [aut, cre, cph] |
Maintainer: | Giancarlo Vercellino <giancarlo.vercellino@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2025-10-08 10:30:08 UTC |
dymo
Description
Dynamic Mode Decomposition for Multivariate Time Feature Prediction
DYMO is an R package for multi-feature time-series forecasting using Dynamic Mode Decomposition (DMD) on scaled returns. It reconstructs future levels by compounding predicted dynamics and applies conformal predictive sampling to generate calibrated uncertainty distributions. The result is a fast, interpretable, and distribution-free forecasting framework with fully empirical predictive intervals and ggplot visualizations.
Usage
dymo(
df,
horizon,
n_windows = 10,
ci = 0.8,
smoother = FALSE,
min_feats = NULL,
max_feats = NULL,
dates = NULL,
error_scale = "naive",
error_benchmark = "naive",
seed = 42,
n_samp = 1000,
eig_max_mod = 0.995
)
Arguments
df |
A data frame or matrix of numeric time features, where each column represents a different time series of equal length. Must contain at least two features. |
horizon |
Positive integer. Number of forecast steps ahead (horizon) to predict. |
n_windows |
Positive integer. Number of validation windows used for residual and error estimation. Default: 10. |
ci |
Numeric in (0, 1). Confidence level for the conformal predictive intervals. Default: 0.8. |
smoother |
Logical. Whether to apply automatic LOESS smoothing to the input time series before modeling. Default: FALSE. |
min_feats , max_feats |
Positive integers. Minimum and maximum number of features to combine in the multifeature DMD. By default both are set to the total number of columns in df. |
dates |
Optional vector of 'Date' objects (same length as the rows of df). If supplied, forecast plots will use date labels and forecast dates will be extrapolated automatically. |
error_scale |
Character string specifying the scaling used in normalized error metrics. Options: "naive" (average one-step absolute error of the historical series) or "deviation" (standard deviation of the series). Default: '"naive"'. |
error_benchmark |
Character string specifying the benchmark used for relative error metrics. Options: "naive" (last value persistence) or "average" (mean value). Default: "naive". |
seed |
Positive integer. Random seed for reproducibility. Default: 42. |
n_samp |
Positive integer. Number of conformal samples to draw for each feature and horizon. Default: 1000. |
eig_max_mod |
Numeric in (0,1]. Maximum allowed eigenvalue modulus for DMD eigenmodes (values greater than this are clipped to prevent divergence). Default: 0.995. |
Value
A list with three top-level components:
- 'comb_metrics'
A data frame containing averaged forecast metrics and scores for all tested feature combinations and DMD ranks. Columns include rank, prediction scores, and standard error metrics such as MAE, MAPE, RMSSE, MASE, etc.
- 'best_model'
A list summarizing the best-performing feature combination and DMD rank, containing:
- 'best_combination'
Character string describing which features and rank were selected.
- 'quant_preds'
List of matrices (one per feature) summarizing forecast quantiles, mean, and standard deviation for each horizon.
- 'point_forecast'
Matrix of point (mean) forecasts on the original level scale. Rows = features, columns = forecast steps.
- 'samples'
List of matrices (one per feature) containing conformal resampled level trajectories (n_samp x horizon).
- 'empfuns'
List of empirical distribution functions per feature and horizon. Each element contains:
rfun(n)
,pfun(x)
,qfun(p)
,dfun(x)
.- 'testing_errors'
Vector of average forecast error metrics for the best rank and feature combination.
- 'plots'
List of ggplot objects visualizing the historical data, forecast mean, and predictive intervals for each feature.
- 'time_log'
Character string giving the elapsed computation time in "hh:mm:ss" format.
Author(s)
Maintainer: Giancarlo Vercellino giancarlo.vercellino@gmail.com [copyright holder]
See Also
Useful links:
Examples
dymo(time_features[,c(2, 3, 4)], horizon = 10, dates = time_features$dates)
time features example: IBM, AAPL, AMZN, GOOGL and MSFT Close Prices
Description
A data frame with with daily with daily prices for some Big Tech Companies since March 2017.
Usage
time_features
Format
A data frame with 6 columns and 1336 rows.
Source
finance.yahoo.com