Conditional Regime Analog Forecasting with Trajectories

Tools for Conditional Regime Analog Forecasting with Trajectories. The package builds lag and lead trajectory embeddings, detects regimes with singular value decomposition and changepoint analysis, estimates transition probabilities between regimes, samples future-trajectory analogues, and fits smooth empirical forecast distributions.


CRAFT

CRAFT provides Conditional Regime Analog Forecasting with Trajectories tools for multivariate time series. It builds lag and lead trajectory embeddings, detects SVD-based changepoint regimes, estimates transition probabilities, samples plausible future-trajectory analogues, and fits smooth empirical forecast distributions.

Installation

After CRAN release:

install.packages("CRAFT")

For local development from this folder:

install.packages(".", repos = NULL, type = "source")

Basic workflow

library(CRAFT)

set.seed(1)
series <- data.frame(
  asset_a = cumprod(1 + rnorm(100, 0.001, 0.01)),
  asset_b = cumprod(1 + rnorm(100, 0.0005, 0.012))
)

fit <- craft_fit(
  series,
  window = 5,
  n_draws = 100,
  n_factors = 1,
  min_segment = 5,
  max_regimes_per_factor = 3,
  n_testing = 0,
  verbose = FALSE
)

fit$valid_joint_acc
pred <- craft_predict(fit, n_draws = 25, seed = 1)

names(pred$return_dists)

Lower-level functions are available for custom pipelines:

  • trajectory_embedding() builds aligned past and future trajectory matrices.
  • svd_changepoint_regimes() detects regimes in transformed time-series data.
  • regime_sampler() samples historical future-trajectory rows from regime probabilities.
  • trajectory_forecast() fits smooth empirical forecast distributions.
  • denoiser() selects informative numeric features before regime detection.
  • time_volume_weights() creates volume-derived observation weights.

CRAN submission note

Before submitting to CRAN, replace the placeholder maintainer email in DESCRIPTION with the real maintainer email address.

License

MIT + file LICENSE

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("CRAFT")

0.1.0 by Giancarlo Vercellino, 2 months ago


https://rpubs.com/giancarlo_vercellino/craft


Browse source code at https://github.com/cran/CRAFT


Authors: Giancarlo Vercellino [aut, cre, cph]


Documentation:   PDF Manual  


GPL-3 license


Imports changepoint, graphics, grDevices, parallel, stats, utils

Suggests knitr, rmarkdown, testthat


See at CRAN