plot_mvgam_resids {mvgam}R Documentation

Residual diagnostics for a fitted mvgam object

Description

This function takes a fitted mvgam object and returns various residual diagnostic plots

Usage

plot_mvgam_resids(object, series = 1, newdata, data_test)

Arguments

object

list object returned from mvgam. See mvgam()

series

integer specifying which series in the set is to be plotted

newdata

Optional dataframe or list of test data containing at least 'series', 'y', and 'time' in addition to any other variables included in the linear predictor of formula. If included, the covariate information in newdata will be used to generate forecasts from the fitted model equations. If this same newdata was originally included in the call to mvgam, then forecasts have already been produced by the generative model and these will simply be extracted and used to calculate residuals. However if no newdata was supplied to the original model call, an assumption is made that the newdata supplied here comes sequentially after the data supplied as data in the original model (i.e. we assume there is no time gap between the last observation of series 1 in data_train and the first observation for series 1 in newdata).

data_test

Deprecated. Still works in place of newdata but users are recommended to use newdata instead for more seamless integration into R workflows

Details

A total of four base R plots are generated to examine Dunn-Smyth residuals for the specified series. Plots include a residuals vs fitted values plot, a Q-Q plot, and two plots to check for any remaining temporal autocorrelation in the residuals. Note, all plots use posterior medians of fitted values / residuals, so uncertainty is not represented.

Value

A series of base R plots

Author(s)

Nicholas J Clark


[Package mvgam version 1.1.2 Index]