Skip to content

Fitted Values and Forecasts

Ivan Svetunkov edited this page Feb 11, 2026 · 19 revisions

Fitted Values and Forecasts

This page documents methods for extracting fitted values and generating forecasts from smooth models.

predict()/forecast()

Generates point forecasts and optionally prediction intervals for h steps ahead.

In R, the standard method is forecast(), although predict() is also available, but with a limited functionality and focusing on the in-sample prediction.

In Python, use predict() method.

R Usage

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

# Out-of-sample prediction
pred <- forecast(model, h=12, interval="prediction")

# In-sample confidence intervals
pred <- predict(model, interval="confidence")

Python Usage

from smooth import ADAM

# Fit model
model = ADAM(model="ZZZ", lags=12)
model.fit(y)

# Basic point forecast (no intervals by default, matching R)
forecasts = model.predict(h=12)

# With prediction intervals (auto-selects method)
forecasts = model.predict(h=12, interval="prediction", level=0.95)

# Approximate (parametric) intervals
forecasts = model.predict(h=12, interval="approximate", level=0.95)

# Simulation-based intervals
forecasts = model.predict(
    h=12, interval="simulated",
    level=0.95, nsim=1000
)

# One-sided intervals
forecasts = model.predict(h=12, interval="prediction", level=0.95, side='upper')

# Access prediction intervals via predict_intervals()
intervals = model.predict_intervals(h=12, levels=[0.8, 0.95])

Parameters

Parameter Type (R) Type (Python) Default (R / Python) Description
object adam ADAM - Fitted model
h integer int 10 / required Forecast horizon
newdata / X matrix/data.frame NDArray NULL / None Exogenous variables for forecast period
occurrence numeric vector NDArray NULL / None Future occurrence probabilities (values in [0,1]) if known
interval character str "none" / "none" Interval type (see table below)
level numeric float/list 0.95 / 0.95 Confidence level(s)
side character str "both" / "both" Interval side: "both", "upper", "lower"
cumulative logical bool FALSE / False Produce cumulative forecasts (useful for inventory control)
nsim integer int NULL / 10000 Number of simulations for simulation-based intervals
scenarios logical bool FALSE / False Return simulated scenarios (only for interval="simulated")
... - - - Other parameters passed to underlying functions

Interval Types

Type Description Best For R Python
"none" No intervals Point forecasts only Yes Yes
"prediction" Analytical for additive, simulated for others General use (recommended) Yes Yes
"approximate" Analytical formulae for conditional variance Fast, additive models Yes Yes
"simulated" Monte Carlo simulation Multiplicative models Yes Yes
"semiparametric" Based on multi-step forecast errors and assumed distribution When residuals are not i.i.d. Yes -
"nonparametric" Quantile regression (Taylor & Bunn, 1999) Distribution-free Yes -
"empirical" Empirical quantiles of multi-step forecast errors Distribution and model free Yes -
"confidence" Confidence intervals for point forecast via reforecast() Uncertainty in the forecast line Yes -
"complete" Accounts for parameter uncertainty via reforecast() Full uncertainty quantification Yes -

Note: "semiparametric", "nonparametric" and "empirical" use the rmultistep() method to extract multistep in-sample forecast errors. See more in Residuals-and-Errors.

Output

R: Returns an object of class "adam.forecast" / "smooth.forecast".

Python: predict() returns a pandas DataFrame with a "mean" column and optional interval columns (e.g., "lower 95%", "upper 95%") when interval is not "none".

Element Description R Python
model The estimated model object Yes -
method Name of the model (e.g., "ETS(M,M,M)") Yes -
mean / forecast Point forecasts (conditional mean) Yes Yes
lower Lower prediction bounds (matrix with columns per level) Yes Yes
upper Upper prediction bounds (matrix with columns per level) Yes Yes
level Confidence level(s) used Yes Yes
side Which side of intervals was requested - Yes
interval Whether intervals were produced (logical) Yes -
scenarios Matrix of simulated scenarios (h × nsim) Yes Yes

Notes:

  • In R, access elements via $ (e.g., fc$mean, fc$lower)
  • In Python, predict() returns a DataFrame; use predict_intervals() for a convenience wrapper with multiple levels
  • In both R and Python, scenarios is only populated when interval="simulated" and scenarios=TRUE/True

fitted()

Extracts fitted (in-sample predicted) values from the model.

R Usage

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

# Get fitted values
fitted(model)

Python Usage

from smooth import ADAM

model = ADAM(model="MMM", lags=12)
model.fit(y)

# Get fitted values
fitted_values = model.fitted

Output

R: Returns a time series with fitted values for each in-sample observation.

Python: Returns an NDArray with fitted values for each in-sample observation.

actuals()

Extracts the actual (observed) values used in model estimation.

R Usage

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

# Get actuals
y <- actuals(model)

Python Usage

from smooth import ADAM

model = ADAM(model="MMM", lags=12)
model.fit(y)

# Get actuals (the data used for fitting)
actuals = model.actuals

Output

R: Returns a time series with the actual in-sample observations.

Python: Returns an NDArray with the actual in-sample observations.

See Also

Clone this wiki locally