Skip to content

Refitting and Reforecasting

Ivan Svetunkov edited this page Jan 30, 2026 · 7 revisions

Refitting and Reforecasting Methods

This page documents methods for understanding parameter uncertainty and generating prediction intervals that account for both parameter and future uncertainty. These methods work with objects returned by ADAM and related functions.

Note: Not yet implemented in Python.

reapply()

Reapplies the model with randomly generated parameters based on the covariance matrix of the estimated parameters. This helps understand how parameter uncertainty affects fitted values.

R Usage

library(smooth)

# Fit model
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# Reapply with random parameters (100 paths)
reappliedModel <- reapply(model, nsim=100)
plot(reappliedModel)

How It Works

  1. Extracts the variance-covariance matrix of estimated parameters
  2. Generates random parameter sets from a multivariate normal distribution centered on estimates
  3. Refits the model with each parameter set
  4. Returns fitted paths for analysis

Read more about it in Section 16.5 of Svetunkov (2023).

Parameters

Parameter Type (R) Type (Python) Default Description
object adam - - Fitted ADAM model
nsim integer - 1000 Number of simulation paths
bootstrap logical - FALSE Use bootstrap sampling instead of parametric to get covariance matrix of parameters
heuristics logical - FALSE Use heuristic bounds for parameters

Output

Returns a matrix with:

  • Rows: Time points
  • Columns: Simulation paths

Example

model <- adam(AirPassengers, "AAN", h=12, holdout=TRUE)

# Generate 500 paths
reappliedModel <- reapply(model, nsim=500)

# Compute confidence intervals for fitted values
fitted_lower <- apply(reappliedModel, 1, quantile, probs=0.025)
fitted_upper <- apply(reappliedModel, 1, quantile, probs=0.975)

# Plot with uncertainty bands
plot(reappliedModel)

reforecast()

Produces forecasts using randomly generated parameters (via reapply) combined with simulated future errors. This provides prediction intervals that account for both parameter uncertainty and future uncertainty. Can also generate confidence interval for the forecasts, i.e. showing uncertainty about the line itself (don't confuse with the prediction ones).

R Usage

library(smooth)

# Fit model
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# Generate forecasts
modelForecast <- reforecast(model, h=12, nsim=500)

How It Works

  1. Uses reapply to get model fits with different parameter sets
  2. For each parameter model fit, simulates future errors from the estimated distribution
  3. Produces forecast paths that incorporate both sources of uncertainty
  4. Returns matrix of forecast paths for constructing prediction intervals

Parameters

Parameter Type (R) Type (Python) Default Description
object adam - - Fitted ADAM model
h integer - 10 Forecast horizon
nsim integer - 100 Number of simulation paths. Also passed to reapply
bootstrap logical - FALSE Pass parameter to reapply
heuristics logical - FALSE Pass parameter to reapply

Output

Returns a matrix with:

  • Rows: Forecast horizons (1 to h)
  • Columns: Simulation paths

Example

model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)

# Generate forecasts
modelForecast <- reforecast(model, h=12, nsim=500, interval="prediction")
plot(modelForecast)

Comparison with Standard Intervals

Method Parameter Uncertainty Future Uncertainty Speed
forecast(..., interval="parametric") No Yes (assumed) Fast
forecast(..., interval="simulated") No Yes (simulated) Moderate
reforecast() Yes Yes Slow

Use reforecast() when:

  • Parameter uncertainty is substantial (small samples, complex models)
  • Parameters are close to zero
  • You need the more calibrated prediction intervals than in case of the simple ones
  • Computational time is not a constraint

See Also

Clone this wiki locally