Package 'dymo'

Title: Dynamic Mode Decomposition for Multivariate Time Feature Prediction
Description: An application of Dynamic Mode Decomposition for prediction of time features. Automatic search for the best model across the space of all possible feature combinations and ranks of Singular Value Decomposition.
Authors: Giancarlo Vercellino [aut, cre, cph]
Maintainer: Giancarlo Vercellino <[email protected]>
License: GPL-3
Version: 1.1.0
Built: 2024-10-25 06:04:28 UTC
Source: https://github.com/cran/dymo

Help Index


dymo

Description

Dynamic Mode Decomposition for Multivariate Time Feature Prediction

Usage

dymo(
  df,
  seq_len,
  n_windows = 10,
  ci = 0.8,
  smoother = FALSE,
  min_feats = NULL,
  max_feats = NULL,
  dates = NULL,
  error_scale = "naive",
  error_benchmark = "naive",
  seed = 42
)

Arguments

df

A data frame with time features on columns. You need at least two time features. In case of missing values, automatic missing imputation through kalman filter will be performed.

seq_len

Positive integer. Time-step number of the forecasting sequence. Default: NULL (automatic selection between 1 and the square root of full length).

n_windows

Positive integer. Number of validation windows to test prediction error. Default: 10.

ci

Confidence interval for prediction. Default: 0.8

smoother

Logical. Flag to TRUE for loess smoothing. Default: FALSE.

min_feats

Positive integer. Minimum number of time features to combine. Default: NULL (set equal to the total number of features)

max_feats

Positive integer. Maximum number of time features to combine. Default: NULL (set equal to the total number of features)

dates

Date. Vector with dates for time features.

error_scale

String. Scale for the scaled error metrics. Two options: "naive" (average of naive one-step absolute error for the historical series) or "deviation" (standard error of the historical series). Default: "naive".

error_benchmark

String. Benchmark for the relative error metrics. Two options: "naive" (sequential extension of last value) or "average" (mean value of true sequence). Default: "naive".

seed

Positive integer. Random seed. Default: 42.

Value

This function returns a list including:

  • comb_metrics: error metrics for all possible combinations of time features (for each combination, pred_score, me, mae, mse, rmsse, mpe, mape, rmae, rrmse, rame, mase, smse, sce, gmrae, are averaged across features, ranks and validation windows)

  • best_model: best combination resulting from the average prediction score across different ranks and features, including:

    • best_combination: combination of indexes and rank for the best model

    • testing_errors: testing errors for each time feature averaged across validation windows

    • quant_preds: min, max, q25, q50, q75, quantiles at selected ci, mean, sd, mode, skewness, kurtosis, IQR to range, median range ratio, upside probability and divergence for each point fo predicted sequences

    • plots: standard plot with confidence interval for each time feature

  • time_log

Author(s)

Maintainer: Giancarlo Vercellino [email protected] [copyright holder]

Giancarlo Vercellino [email protected]

See Also

Useful links:

Examples

dymo(time_features[,c(2, 3, 4)], seq_len = 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