Source-linked AI summary

Scalable visualisation methods for modern Generalized Additive Models

Matteo Fasiolo, Raphaël Nedellec, Yannig Goude, Simon N. Wood

arXiv:1809.10632v2stat.MEstat.AP

TL;DR

The paper addresses the shortage of visualisation tools for increasingly complex and large-scale GAMs. It proposes scalable, interactive, additive-structure-aware diagnostics and uncertainty visualisations implemented in mgcViz, illustrated with electricity-load forecasting. The methods support rapid exploration of large data sets and broader response distributions, while the paper identifies remaining extension needs for non-standard models and model comparison.

  • Problem

    Visual methods for GAM model development and results presentation have not kept pace with increasingly complex models, large data sets, and response distributions beyond simple exponential-family regression.

  • Method

    The paper develops scalable interactive visual tools that exploit GAM additivity, bin large data sets, quantify residual and smooth-effect uncertainty, and are implemented in the mgcViz R package.

  • Results

    The tools support interactive visual checking for data sets of 10^7 to 10^8 observations and produce QQ-curve calculations and reference intervals for size 10^7 data sets within a few seconds.

  • Takeaways & Limitations

    Visual checks support interactive model building and help practitioners understand included effects and assess their physical plausibility in complex GAM applications.

  • Takeaways & Limitations

    The authors identify planned extensions for bespoke methods for other non-standard models and for comparing plots from different GAMs.

Abstract

from arXiv · show

In the last two decades the growth of computational resources has made it possible to handle Generalized Additive Models (GAMs) that formerly were too costly for serious applications. However, the growth in model complexity has not been matched by improved visualisations for model development and results presentation. Motivated by an industrial application in electricity load forecasting, we identify the areas where the lack of modern visualisation tools for GAMs is particularly severe, and we address the shortcomings of existing methods by proposing a set of visual tools that a) are fast enough for interactive use, b) exploit the additive structure of GAMs, c) scale to large data sets and d) can be used in conjunction with a wide range of response distributions. All the new visual methods proposed in this work are implemented by the mgcViz R package, which can be found on the Comprehensive R Archive Network.

1 Introduction

The paper proposes scalable visualisation tools for interactive checking and development of complex GAMs, motivated by large electricity-load models whose modern fitting capabilities outpace existing visual methods.

  • 1 Introduction: The proposed tools target interactive GAM checking and development for large data sets, addressing cases where rendering residual checks can outlast model fitting.The methods bin and summarise data to support interactive handling of data sets with 10^7 to 10^8 observations within seconds.
  • 1 Introduction: Modern GAM frameworks can model multiple response-distribution parameters, but their flexibility increases the need for visual variable selection and uncertainty-aware residual diagnostics.The framework includes GAMLSS-like models in which all response-distribution parameters may depend on additive covariate effects.
  • 1 Introduction: Interactive visualisation is important because forecasters must assess estimated effects' physical plausibility and decide when unusual covariate configurations permit safe model use.The application motivates smooth-effect plots that support visual uncertainty assessment and interactive manipulation.
  • 1 Introduction: The electricity-demand application uses a Gaussian GAM with calendar, lagged-load, trend, temperature, and time-of-day effects, including bivariate smooths for interactions.Temperature smoothing with α = 0.05 represents thermal inertia, while tensor-product smooths model interactions involving temperature, interval, and time of year.

2 Software

The software contribution is mgcViz, an extensible layer-based framework that converts mgcv GAM fits into modular visual objects for scalable model checking and effect exploration.

  • 2 Software: mgcViz extends mgcv with scalable, interactive visual tools for GAM model development and results presentation across varied smooth effects and response distributions.The implementation focuses on mgcv but the visual methods could be applied to GAMs fitted with other software.
  • 2 Software: The framework exploits GAM additivity by extracting individual smooth or parametric terms and dispatching their visualisation through modular object classes.A fitted GAM is converted to a gamViz object; smooths become plotSmooth objects and parametric terms can be plotted similarly.
  • 2 Software: Layered ggplot2-based objects allow fitted effects, residual-density heatmaps, confidence intervals, and other diagnostics to be superposed and extended with new methods.Functions prefixed l_ generate graphical layers that are combined with the overloaded + operator.
  • 2 Software: The authors argue that the object-oriented layered design is essential for an extensible, user-friendly, maintainable visual toolbox rather than a collection of multipurpose plotting functions.Each visual tool is accompanied by its mathematical and algorithmic structure and its mgcViz implementation reference.

3 Visual tools for interactive GAM model building

The paper develops scalable visual diagnostics for GAMs that support interactive checking across marginal and conditional residual distributions, including models beyond simple exponential-family mean regression. Its tools combine fast QQ-plots, binned conditional checks, and uncertainty-aware visualisations to guide model refinement in large-data electricity forecasting.

  • 3.1 Scalable interactive QQ-plots for general GAMs: QQ-plots use non-asymptotic reference intervals and are designed for interactive exploration across almost any response distribution.For residual types based on conditional CDF transformations, qq.gamViz computes the QQ-curve and intervals for 10^7 observations in a few seconds on one core.
  • 3.1 Scalable interactive QQ-plots for general GAMs: Binning reduces QQ-plot rendering costs to O(n), allowing interactive zooming when plotting raw or simulated curves would be infeasible.With n = 10^7 and l = 10^2, avoiding binning would require plotting 10^9 points; binning takes less than a second in this setting.
  • 3.2 Beyond QQ-plots: conditional residual checks: Conditional residual checks compare observed and model-based residual distributions along covariates to reveal outliers, omitted variables, nonlinearities, heteroscedasticity, and dependence patterns.The layered check1D and check2D tools estimate conditional residual structure with scalable kernel-density and binning procedures.
  • 3.2 Beyond QQ-plots: conditional residual checks: Distance heatmaps expose detailed conditional-distribution anomalies, while simulated-reference summaries assess whether observed heteroscedasticity or skewness is unusual.The latter summaries support one- and two-dimensional binned comparisons using simulated residual vectors and can focus on conditional variance or skewness.
  • 3.3 Load forecasting: improving the Gaussian GAM: In the load-forecasting application, residual diagnostics supported a Gaussian location-scale model with covariate-varying variance and further suggested modelling skewness by interval and calendar variables.The location-scale model reduced AIC from 1.68 × 10^6 to 1.62 × 10^6, while diagnostic patterns motivated additional distributional modelling.

4 Visualising smooth effect uncertainty

The paper introduces visual methods for assessing smooth-effect significance and uncertainty in multidimensional GAMs, then applies them to a shash GAMLSS load-forecasting model.

  • 4 Visualising smooth effect uncertainty: Opacity and random perturbations visualize smooth-effect significance and uncertainty without binary confidence regions or an added dimension.Opacity is based on local significance, while Gaussian noise with variance equal to the estimated local variance perturbs the fitted surface.
  • 4 Visualising smooth effect uncertainty: 3D interactive rendering provides another way to inspect fitted effects and confidence surfaces.The plotRGL function supports interactive manipulation such as rotating each plot in an array.
  • 4.1 Load forecasting: adopting a GAMLSS model: The shash model fixes the tail parameter at δ = 1 after estimation diverged, yielding 1013 regression coefficients and 11 smoothing parameters.The fitted shash model has AIC 1.608 × 10^6, and all terms in the skewness model are significant at the 0.01 level.
  • 4.1 Load forecasting: adopting a GAMLSS model: The shash model improves the QQ-plot, but worm-plots and conditional-density heatmaps still reveal lower-tail non-normality, time-dependent over-dispersion, and multimodality.These diagnostics suggest that the cyclic basis for the scale effect may be inappropriate and that weekday load-profile differences or missing tariff information may matter.
  • 4.1 Load forecasting: adopting a GAMLSS model: The location effects show stronger instantaneous-temperature influence during the day, stronger low-temperature-history influence at night, and a complex uncertain time-of-year interaction.The temperature-history effect is barely significant above 20°C, while the time-of-year effect has four maxima separated by the year-end demand drop.

5 Conclusions

The paper presents scalable visual tools for results presentation, model checking, and interactive GAM building. It argues that these tools support interpretable model development while identifying extensions still needed for broader models and predictive comparison.

  • 5 Conclusions: The proposed tools support results presentation, model checking, and interactive building of general GAMs.The authors emphasize visual model development rather than automated variable selection for large, complex data sets.
  • 5 Conclusions: Visual checks help practitioners understand why effects are included and assess confidence in models used in industrial forecasting.The paper connects this interpretability to adoption of more sophisticated GAMs where forecasting errors have practical consequences.
  • 5 Conclusions: The layer-based mgcViz framework is designed for future extensions, including bespoke diagnostics for functional GAMs and animated uncertainty visualizations.The authors also identify plot comparison and predictive-performance tools as useful future developments.

A Interpreting the output of l_densCheck

The l_densCheck examples show how conditional residual diagnostics reveal misspecified location, scale, skewness, or tail behavior. A well-specified model instead shows no clear residual pattern and only random differences from the reference normal density.

  • A Interpreting the output of l_densCheck: The l_densCheck examples use quantile residuals and compare conditional residual densities with a standard normal reference.The examples simulate responses from a sinh-arcsinh distribution and fit a sequence of GAMLSS models.
  • A Interpreting the output of l_densCheck: A quadratic residual pattern in the covariate indicates that the location model is misspecified.The conditional residual-density plots provide complementary checks at selected covariate values.
  • A Interpreting the output of l_densCheck: Increasing residual variance with the covariate indicates that the scale predictor should include a smooth effect of that covariate.The residual density is under-dispersed near x ≈ −3, approximately correct near x ≈ 0, and over-dispersed near x ≈ 3.
  • A Interpreting the output of l_densCheck: Covariate-dependent skewness or tail weight signals missing smooth effects in the predictors controlling skewness or kurtosis.The examples show left-to-right skewness changes and excessive tail weight near x ≈ ±3.
  • A Interpreting the output of l_densCheck: When the response distribution is well specified, residuals show no clear pattern and empirical densities differ randomly from N(0, 1).

B Uncertainty visualisation in 2D smooth effect plots

The paper combines visual residual-distribution checks with 2D effect displays that compare fitted structure, truth, perturbations, and significance. These views expose distributional misspecification and represent uncertainty in fitted smooth effects.

  • Uncertainty visualisation in 2D smooth effect plots: For a well-specified model, the corresponding diagnostic display shows no clear pattern.
  • Uncertainty visualisation in 2D smooth effect plots: Figure 12 compares the fitted 2D effect with the truth, a perturbed fitted effect, and a significance-weighted opacity display.The tensor-product estimate is shrunk toward a flat surface by the smoothing penalty, with a linear trend remaining.
Loading 1809.10632v2…