| Type: | Package |
| Title: | Multi-Horizon Probabilistic Ensemble with Copulas for Time Series Forecasting |
| Version: | 1.0.1 |
| Maintainer: | Giancarlo Vercellino <giancarlo.vercellino@gmail.com> |
| Description: | Trains per-horizon probabilistic ensembles from a univariate time series. It supports 'rpart', 'glmnet', and 'kNN' engines with flexible residual distributions and heteroscedastic scale models, weighting variants by calibration-aware scores. A Gaussian/t copula couples the marginals to simulate joint forecast paths, returning quantiles, means, and step increments across horizons. |
| License: | GPL-3 |
| RoxygenNote: | 7.3.3 |
| Imports: | rpart (≥ 4.1.24), glmnet (≥ 4.1-10), Matrix (≥ 1.7-3), MASS (≥ 7.3-65), imputeTS (≥ 3.4) |
| Encoding: | UTF-8 |
| URL: | https://rpubs.com/giancarlo_vercellino/organik |
| Suggests: | knitr, testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Depends: | R (≥ 4.1.0) |
| NeedsCompilation: | no |
| Packaged: | 2025-11-26 10:39:42 UTC; gianc |
| Author: | Giancarlo Vercellino [aut, cre, cph] |
| Repository: | CRAN |
| Date/Publication: | 2025-11-26 11:20:02 UTC |
Multi-Horizon Probabilistic Ensemble with Copulas for Time Series Forecasting
Description
Trains per-horizon probabilistic ensembles from a univariate time series. It supports 'rpart', 'glmnet', and 'kNN' engines with flexible residual distributions and heteroscedastic scale models, weighting variants by calibration-aware scores. A Gaussian/t copula couples the marginals to simulate joint forecast paths, returning quantiles, means, and step increments across horizons.
Usage
organik(
ts,
horizon,
n_variants = 10,
engines = c("rpart", "glmnet", "knn"),
dists = c("gaussian", "laplace", "student", "logistic", "asymmetric_laplace",
"skew_normal", "skew_t"),
h_options = c("tree", "ridge"),
alpha = 1,
beta = 1,
temperature = 1,
dates = NULL,
ci = 0.95,
n_testing = 30,
seed = 42
)
Arguments
ts |
Numeric vector (time series levels). |
horizon |
Integer, number of steps ahead. |
n_variants |
Integer, number of model variants per horizon (ensemble size). |
engines |
Character vector of supported mean-model engines ('rpart', 'glmnet', 'knn'). |
dists |
Character vector of supported residual distributions (gaussian, laplace, student, logistic, asymmetric_laplace, skew_normal, skew_t. |
h_options |
Character vector for supported heteroscedastic scale models (tree, ridge). |
alpha, beta |
Numeric weights combining CRPS and calibration error. |
temperature |
Softmax temperature for ensemble weighting (>0). |
dates |
Vector for date formats. Default: NULL. |
ci |
Numeric scalar, confidence interval for plot. Default: 0.9. |
n_testing |
Backtest spacing used inside components. |
seed |
Optional integer seed for reproducibility. |
Value
A list of class 'c("organik","list")' with elements:
'model_list': list of horizon-wise ensemble models.
'growth_pred_funs': list of marginal predictors for growth.
'level_pred_funs': list of marginal predictors for level.
'cor_mat': horizon-by-horizon correlation (after cleaning / nearPD).
'path_prediction(n_paths, probs, copula=c("gaussian","t"), df, return_increments, seed)': function that simulates joint paths and returns summaries (means, quantiles, cumulative growth paths, level paths, and incremental returns if requested).
'plot': plot with prediction in the confidence interval.
Author(s)
Maintainer: Giancarlo Vercellino giancarlo.vercellino@gmail.com [copyright holder]
See Also
Useful links:
Examples
set.seed(1)
y <- cumsum(rnorm(200, sd = 0.5)) + 10
obj <- organik(y, horizon = 4,
n_variants = 3,
engines = "knn",
dists = c("gaussian","laplace"),
h_options = "tree",
n_testing = 3, seed = 123)
# joint path simulation for next 4 steps:
path <- obj$path_prediction(n_paths = 100)
str(path$level_quants)