rollcast

rollcast implements Rollcast, a probabilistic time-series forecasting framework based on adaptive mixtures of rolling statistical anchors.

Main ideas

The model uses rolling mean, median, minimum, maximum, regression endpoint, and configurable quantiles as predictive anchors. A proper-score softmax gate learns state-dependent mixture weights. State-conditional residuals can be added with tunable strength, and recursive simulation returns full predictive distributions.

Install from source

install.packages("Rcpp")
install.packages("rollcast_0.1.0.tar.gz", repos = NULL, type = "source")

For development from the package directory:

install.packages(c("Rcpp", "testthat", "knitr", "rmarkdown"))

Then run:

R CMD build rollcast
R CMD check --as-cran rollcast_0.1.0.tar.gz

Basic use

library(rollcast)

set.seed(1)
y <- 100 + cumsum(rnorm(400))

fit <- rollcast(
  y,
  window = 60,
  tau = 0.25,
  lambda = 0.01,
  conditional_k = 40,
  state_bw = 1,
  residual_bw = 0.35,
  error_scale = 0.25,
  residual_smoothing = 0.03,
  rho_min = 0.05,
  rho_max = 0.90,
  rho_decay = 1
)

pred <- predict(fit, horizon = 20, nsim = 3000, seed = 123)
plot(pred)

A numeric hyperparameter supplied as a scalar is fixed. A candidate vector requests causal validation-based tuning.