-
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.
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.
Note: Not yet implemented in Python.
model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
summary(model)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)- ADAM - Main ADAM function
- Coefficients-and-Parameters - Extracting model parameters
- Model-Information - Model diagnostics and information