Package 'GACE'

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

Help Index


GACE Forecasting Engine (Generalized Adaptive Capped Estimator)

Description

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.

Usage

gace_forecast(
  df,
  periods = 12,
  freq = c("week", "month", "quarter", "year"),
  seasonal = TRUE,
  cap_low = -0.3,
  cap_high = 0.3,
  verbose = FALSE
)

Arguments

df

Numeric vector or time series of historical values.

periods

Integer; number of future periods to forecast.

freq

One of "week", "month", "quarter", or "year". Used when df is not a ts object.

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.

Details

This is the main user-facing function. It wraps the internal engine and returns a data frame suitable for plotting and downstream analysis.

Value

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.

Examples

set.seed(1)
y <- ts(rnorm(60, mean = 100, sd = 10), frequency = 12)
fc <- gace_forecast(y, periods = 12, freq = "month")
head(fc)

Plot GACE Forecast

Description

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.

Usage

plot_gace(fc)

Arguments

fc

A data frame (or tibble) returned by gace_forecast, containing at least the columns:

  • period – numeric index for periods,

  • value – observed or forecast values,

  • type – "historical" or "forecast".

Value

A ggplot2 object showing the GACE forecast.

Examples

## 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)