| Title: | Generalized Adaptive Capped Estimator for Time Series Forecasting |
|---|---|
| Description: | Provides deterministic forecasting for weekly, monthly, quarterly, and yearly time series using the Generalized Adaptive Capped Estimator. The method includes preprocessing steps for handling missing and extreme values, extraction of multiple growth components (including long-term, short-term, rolling, and drift-based signals), volatility-aware asymmetric capping, optional seasonal adjustment through damped and normalized seasonal factors, and a recursive forecast formulation with moderated growth. The main interface 'gace_forecast()' returns forecasts in a consistent structure, and 'plot_gace()' offers visualization support. Related forecasting background is discussed in Hyndman and Athanasopoulos (2021) <https://otexts.com/fpp3/> and Hyndman and Khandakar (2008) <doi:10.18637/jss.v027.i03>.The method extends classical extrapolative forecasting approaches and is suited for operational and business planning contexts where stability and interpretability are important. |
| Authors: | Vinodhkumar Gunasekaran [aut, cre] |
| Maintainer: | Vinodhkumar Gunasekaran <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-12 08:09:06 UTC |
| Source: | https://github.com/vinoalles/gace |
A deterministic forecasting method that combines hybrid growth signals, volatility-aware asymmetric caps, and optional seasonal scaling. Supports weekly, monthly, quarterly, and yearly time series.
gace_forecast( df, periods = 12, freq = c("week", "month", "quarter", "year"), seasonal = TRUE, cap_low = -0.3, cap_high = 0.3, verbose = FALSE )gace_forecast( df, periods = 12, freq = c("week", "month", "quarter", "year"), seasonal = TRUE, cap_low = -0.3, cap_high = 0.3, verbose = FALSE )
df |
Numeric vector or time series of historical values. |
periods |
Integer; number of future periods to forecast. |
freq |
One of |
seasonal |
Logical; whether to apply seasonal scaling. |
cap_low |
Numeric; baseline lower growth cap. |
cap_high |
Numeric; baseline upper growth cap. |
verbose |
Logical; if TRUE, prints diagnostic messages. |
This is the main user-facing function. It wraps the internal engine and returns a data frame suitable for plotting and downstream analysis.
A data frame with columns:
period – integer index of historical and forecast periods,
value – observed or forecast values,
type – "historical" or "forecast".
The returned object has S3 class "gace_forecast" and includes
engine details in the "gace_details" attribute.
set.seed(1) y <- ts(rnorm(60, mean = 100, sd = 10), frequency = 12) fc <- gace_forecast(y, periods = 12, freq = "month") head(fc)set.seed(1) y <- ts(rnorm(60, mean = 100, sd = 10), frequency = 12) fc <- gace_forecast(y, periods = 12, freq = "month") head(fc)
Produces a plot of historical values and future forecasts returned by gace_forecast. The output is a ggplot2 object with a clear distinction between historical and forecast periods.
plot_gace(fc)plot_gace(fc)
fc |
A data frame (or tibble) returned by gace_forecast, containing at least the columns:
|
A ggplot2 object showing the GACE forecast.
## Not run: set.seed(1) y <- ts(rnorm(36, 100, 10), frequency = 12) fc <- gace_forecast(y, periods = 12, freq = "month") plot_gace(fc) ## End(Not run)## Not run: set.seed(1) y <- ts(rnorm(36, 100, 10), frequency = 12) fc <- gace_forecast(y, periods = 12, freq = "month") plot_gace(fc) ## End(Not run)