-
Notifications
You must be signed in to change notification settings - Fork 22
Visualisation and Output
This page documents the methods for visualising and printing smooth models. These methods work with objects returned by ADAM, ES, CES, SSARIMA, MSARIMA, GUM, SMA, and OES.
Prints a concise summary of the model to the console.
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
print(model)
# Or simply:
modelmodel = ADAM(model="MMM", lags=12)
model.fit(AirPassengers)
print(model)The print method displays:
- Model type (e.g., "ETS(M,M,M)")
- Initialisation type
- Distribution used
- Loss function value
- Estimated parameters (persistence, phi)
- Number of parameters and observations
- Information criteria (AIC, AICc, BIC, BICc)
- If
holdout=TRUE, the error measures for the holdout are also printed
Note: In Python, the error measures are not automatically calculated for the holdout set.
print()vssummary()(Python):print(model)/str(model)give the concise report shown below. The detailed coefficient table with standard errors and confidence intervals is produced bymodel.summary()(see summary() below), mirroring R's separation betweenprint.adamandsummary.adam.
Time elapsed: 2.73 seconds
Model estimated using adam() function: ETS(MMM)
With backcasting initialisation
Distribution assumed in the model: Gamma
Loss function type: likelihood; Loss function value: 473.813
Persistence vector g:
alpha beta gamma
0.6029 0.0001 0.2600
Sample size: 132
Number of estimated parameters: 4
Number of degrees of freedom: 128
Information criteria:
AIC AICc BIC BICc
955.6260 955.9410 967.1573 967.9262
Forecast errors:
ME: -20.52; MAE: 20.729; RMSE: 26.218
sCE: -93.809%; Asymmetry: -97.1%; sMAE: 7.897%; sMSE: 0.998%
MASE: 0.861; RMSSE: 0.837; rMAE: 0.273; rRMSE: 0.255
Produces diagnostic plots for smooth models. 16 plot types are available, controlled by the which parameter.
# Basic diagnostic plots (default which=c(1,2,4,6))
model <- adam(AirPassengers, "ZZZ", lags=12, h=12, holdout=TRUE)
plot(model)
# Single plot
plot(model, which=1)
# Multiple plots
par(mfcol=c(2,3))
plot(model, which=c(1,2,4,6,10,11))
par(mfcol=c(1,1))
# States decomposition
plot(model, which=12)model = ADAM(model="MMM", lags=12)
model.fit(AirPassengers)
# Default plots (which=[1, 2, 4, 6])
model.plot()
# Single plot — returns a matplotlib Figure
fig = model.plot(which=7)
# Multiple specific plots — returns a PlotCollection
figs = model.plot(which=[1, 6, 10, 12])
# Custom figure size
model.plot(which=[1, 2, 4, 6], figsize=(10, 6))| which | Plot Type | Description |
|---|---|---|
| 1 | Actuals vs Fitted | Scatter plot with diagonal perfect-fit line |
| 2 | Standardised Residuals vs Fitted | With outlier bounds and labels |
| 3 | Studentised Residuals vs Fitted | With outlier bounds and labels |
| 4 | |Residuals| vs Fitted | Absolute residuals; heteroscedasticity check |
| 5 | Residuals² vs Fitted | Squared residuals; heteroscedasticity check |
| 6 | Q-Q Plot | Distribution-specific quantile–quantile plot |
| 7 | Fitted over Time | Actuals and fitted values as a time series |
| 8 | Standardised Residuals vs Time | With outlier bounds |
| 9 | Studentised Residuals vs Time | With outlier bounds |
| 10 | ACF of Residuals | Autocorrelation function |
| 11 | PACF of Residuals | Partial autocorrelation function |
| 12 | States over Time | All model states (level, trend, seasonal, ARIMA) |
| 13 | |Standardised Residuals| vs Fitted | Absolute standardised; scale diagnostic |
| 14 | Standardised Residuals² vs Fitted | Squared standardised; scale diagnostic |
| 15 | ACF of Squared Residuals | ARCH effects diagnostic |
| 16 | PACF of Squared Residuals | ARCH effects diagnostic |
| Parameter | R | Python | Default | Description |
|---|---|---|---|---|
which |
integer vector | int or list of int |
c(1,2,4,6) / [1,2,4,6]
|
Plot types to produce |
level |
numeric | float | 0.95 | Confidence level for bounds/bands |
legend |
logical | bool | FALSE / False | Show legend on applicable plots |
ask |
logical | — | TRUE | Prompt before each plot (R only) |
lowess |
logical | bool | TRUE / True | Add LOWESS smoothing line to scatter plots |
figsize |
— | tuple | (7, 5) | Figure size in inches (Python only) |
In Python, plot() returns:
- A single
matplotlib.figure.Figurewhenwhichis a scalar or length-1 list - A
PlotCollection(iterable container) when multiple plots are requested; supports Jupyter inline rendering automatically
R:
library(smooth)
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
# Full diagnostic suite
par(mfcol=c(4,4))
plot(model, which=1:16)
par(mfcol=c(1,1))
# States decomposition
plot(model, which=12)Python:
from smooth import ADAM
import numpy as np
model = ADAM(model="AAA", lags=[1, 12])
model.fit(y)
# Default diagnostic suite
model.plot()
# All 16 plots
model.plot(which=list(range(1, 17)))
# States decomposition
model.plot(which=12)Provides a detailed summary including parameter estimates with standard errors and confidence intervals.
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
summary(model)from smooth import ADAM
model = ADAM(model="AAN")
model.fit(y)
# summary() returns an ADAMSummary object (distinct from print(model))
s = model.summary()
print(s) # renders the coefficient table + ICs
# The underlying table is a pandas DataFrame
s.coefficients # columns: Estimate, Std. Error, Lower <lo>%, Upper <hi>%
# Custom confidence level / rounding
s = model.summary(level=0.99, digits=6)The printable ADAMSummary / OMSummary is available for ADAM, AutoADAM, ES, MSARIMA, SMA, OM and OMG. It prints the same layout as R's summary.adam, with a trailing
* marking parameters whose confidence interval excludes zero. The OM print is prefixed by an "Occurrence model" header (mirroring R's summary.om).
CES.summary() and AutoCES.summary() return a plain dict of fit summary stats (model name, a, b, loss, IC values, etc.) rather than the ADAMSummary print object.
Standard-error precision: the
Std. Errorcolumn comes from the inverse Fisher Information matrix computed by central finite differences on the log-likelihood. R and Python share the same C++ implementation (src/headers/hessianCore.h) which uses per-parameter relative stepsh_i = ε^(1/4) · max(|x_i|, 1). This matters specifically forinitial="optimal"andinitial="two-stage", whereBincludes the initial level / trend / seasonal states whose magnitudes mirror the data (e.g.level ≈ 280) — with a pure absolute step the FD perturbation would sit below the cost-function precision floor and produce noisy or NaN-retry-imputed SEs for those rows. The relative-step rule makes the SEs trustworthy at the same precision as the smoothing parameters (R-Python parity ≲ 2% on every row).initial="backcasting"/OM/OMGaren't affected (all their parameters satisfy|x_i| ≤ 1so the step degenerates to the original absolute scheme). See Coefficients-and-Parameters#finite-difference-step-rule for the underlying mechanics and the bootstrap-based alternative when the analytical FI is undeterminable.
model = ADAM(model="AAN", initial="optimal")
model.fit(y)
print(model.summary())Output:
Model estimated using ADAM() function: ETS(AAN)
Response variable: y
Distribution used in the estimation: Normal
Loss function type: likelihood; Loss function value: 174.5332
Coefficients:
Estimate Std. Error Lower 2.5% Upper 97.5%
alpha 0.9141 0.0866 0.7426 1.0000 *
beta 0.1034 0.0539 0.0000 0.2101
level 101.5940 1.0391 99.5359 103.6507 *
trend -0.2617 0.5712 -1.3931 0.8689
Error standard deviation: 1.0361
Sample size: 120
Number of estimated parameters: 5
Number of degrees of freedom: 115
Information criteria:
AIC AICc BIC BICc
359.0664 359.5927 373.0038 374.2637
The summary includes:
- Model specification
- Time elapsed
- Loss value and information criteria
- Parameter estimates with:
- Estimate value
- Standard error
- Lower confidence interval
- Upper confidence interval
- Degrees of freedom
model <- adam(BJsales, "AAN", h=12, holdout=TRUE)
summary(model)Output:
Model estimated using adam() function: ETS(AAN)
Response variable: BJsales
Distribution used in the estimation: Normal
Loss function type: likelihood; Loss function value: 240.6045
Coefficients:
Estimate Std. Error Lower 2.5% Upper 97.5%
alpha 1.0000 0.0966 0.8090 1.0000 *
beta 0.2437 0.0802 0.0851 0.4023 *
Error standard deviation: 1.3936
Sample size: 138
Number of estimated parameters: 3
Number of degrees of freedom: 135
Information criteria:
AIC AICc BIC BICc
487.2090 487.3881 495.9908 496.4320
Standard errors are computed using the Fisher Information matrix, which is computationally expensive. For models with many parameters (>30), this calculation may take considerable time. Also, the success of the computation of this depends on how close the loss function value was to the optimum in the estimation.
Creates LaTeX table output from the model summary. Useful for academic papers and reports.
Note: Not yet implemented in Python.
library(xtable)
model <- adam(BJsales, "AAN", lags=12, h=12, holdout=TRUE)
modelSummary <- summary(model)
# Generate LaTeX table
xtable(modelSummary)Produces LaTeX code that can be included directly in documents:
% latex table generated in R 4.5.1 by xtable 1.8-4 package
% Fri Jan 30 09:54:58 2026
\begin{table}[ht]
\centering
\begin{tabular}{rrrrr}
\hline
& Estimate & Std. Error & Lower 2.5\% & Upper 97.5\% \\
\hline
alpha & 1.0000 & 0.0966 & 0.81 & 1.0000 \\
beta & 0.2437 & 0.0802 & 0.09 & 0.4023 \\
\hline
\end{tabular}
\end{table}Plot forecasts with prediction intervals using the forecast() function output.
Note: Not yet implemented in Python.
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
# Generate forecast
modelForecast <- forecast(model, h=24, interval="prediction")
# Plot forecast
plot(modelForecast)
# Multiple confidence levels
modelForecast <- forecast(model, h=24, interval="semiparametric", level=c(0.9, 0.95))
plot(modelForecast)- Svetunkov, I. (2023). Forecasting and Analytics with the Augmented Dynamic Adaptive Model (ADAM). Chapman and Hall/CRC. Online: https://openforecast.org/adam/.
- ADAM - Main ADAM function
- Coefficients-and-Parameters - Extracting model parameters
- Model-Information - Model diagnostics and information