Skip to content

Visualisation and Output

Ivan Svetunkov edited this page May 21, 2026 · 10 revisions

Visualisation and Output Methods

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.

print()

Prints a concise summary of the model to the console.

R Usage

model <- adam(AirPassengers, "MMM", lags=12, h=12, holdout=TRUE)
print(model)
# Or simply:
model

Python Usage

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

print(model)

Output

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() vs summary() (Python): print(model) / str(model) give the concise report shown below. The detailed coefficient table with standard errors and confidence intervals is produced by model.summary() (see #summary below), mirroring R's separation between print.adam and summary.adam.

Example Output

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

plot()

Produces diagnostic plots for smooth models. 16 plot types are available, controlled by the which parameter.

R Usage

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

Python Usage

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

Available Plots

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

Parameters

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)

Return Value

In Python, plot() returns:

  • A single matplotlib.figure.Figure when which is a scalar or length-1 list
  • A PlotCollection (iterable container) when multiple plots are requested; supports Jupyter inline rendering automatically

Examples

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)

summary()

Provides a detailed summary including parameter estimates with standard errors and confidence intervals.

R Usage

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

Python Usage

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)

Available for ADAM, AutoADAM and ES (Gaussian-family models). The returned ADAMSummary object prints the same layout as R's summary.adam, with a trailing * marking parameters whose confidence interval excludes zero.

Python occurrence models: summary() is not yet available for OM / OMG (the cumulative-logistic occurrence distribution is unsupported in the Fisher Information path) — see OM.

Example (Python)

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

Output Contents

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

Example

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

Note on Standard Errors

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.

xtable()

Creates LaTeX table output from the model summary. Useful for academic papers and reports.

Note: Not yet implemented in Python.

R Usage

library(xtable)

model <- adam(BJsales, "AAN", lags=12, h=12, holdout=TRUE)
modelSummary <- summary(model)

# Generate LaTeX table
xtable(modelSummary)

Output

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}

Forecast Plotting

Plot forecasts with prediction intervals using the forecast() function output.

Note: Not yet implemented in Python.

R Usage

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)

See Also

Clone this wiki locally