View source: R/plot_mvgam_resids.R
| plot_mvgam_resids | R Documentation |
This function takes a fitted mvgam object and returns various
residual diagnostic plots
plot_mvgam_resids(object, series = 1, n_draws = 100L, n_points = 1000L)
object |
|
series |
|
n_draws |
|
n_points |
|
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 only
report statistics from a sample of up to 100 posterior draws (to save
computational time), so uncertainty in these relationships may not be
adequately represented.
A facetted ggplot object
Nicholas J Clark
Nicholas J Clark and Matthijs Hollanders
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.