
Plot forecast uncertainty contributions from mvgam models
Source:R/plot_mvgam_uncertainty.R
plot_mvgam_uncertainty.RdPlot forecast uncertainty contributions from mvgam models
Usage
plot_mvgam_uncertainty(
object,
series = 1,
newdata,
data_test,
legend_position = "topleft",
hide_xlabels = FALSE
)Arguments
- object
listobject returned frommvgam. Seemvgam()- series
integerspecifying which series in the set is to be plotted- newdata
A
dataframeorlistcontaining at least 'series' and 'time' for the forecast horizon, in addition to any other variables included in the linear predictor offormula- data_test
Deprecated. Still works in place of
newdatabut users are recommended to usenewdatainstead for more seamless integration intoRworkflows- legend_position
The location may also be specified by setting x to a single keyword from the list: "none", "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". This places the legend on the inside of the plot frame at the given location (if it is not "none").
- hide_xlabels
logical. IfTRUE, no xlabels are printed to allow the user to add custom labels usingaxisfrom baseR
Details
The basic idea of this function is to compute forecasts by ignoring
one of the two primary components in a correlated residual model (i.e. by
either ignoring the linear predictor effects or by ignoring the residual
dynamics). Some caution is required however, as this function was designed
early in the mvgam development cycle and there are now many types of
models that it cannot handle very well. For example, models with shared
latent states, or any type of State-Space models that include terms in the
trend_formula, will either fail or give nonsensical results. Improvements
are in the works to provide a more general way to decompose forecast
uncertainties, so please check back at a later date.