This function takes a fitted mvgam
object and returns various residual diagnostic plots
Arguments
- object
list
object returned frommvgam
. Seemvgam()
- series
integer
specifying which series in the set is to be plotted
Details
A total of four ggplot plots are generated to examine posterior 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 only report statistics from a sample of up to 20 posterior draws (to save computational time), so uncertainty in these relationships may not be adequately represented.
Examples
if (FALSE) {
simdat <- sim_mvgam(n_series = 3, trend_model = AR())
mod <- mvgam(y ~ s(season, bs = 'cc', k = 6),
trend_model = AR(),
noncentred = TRUE,
data = simdat$data_train,
chains = 2,
silent = 2)
# Plot Dunn Smyth residuals for some series
plot_mvgam_resids(mod)
plot_mvgam_resids(mod, series = 2)
}