Visualize a fitted mf_model() object either as an in-sample fit or as a
forecast with prediction intervals.
Arguments
- x
A
"mf_model"object returned bymf_model().- type
Plot type. Use
"forecast"to plot the observed target history together with the bridge forecast, or"fit"to compare the observed target to the in-sample fitted values.- level
Forecast interval level passed to
forecast.mf_model()whentype = "forecast".- history_n
Number of historical target observations to display. Defaults to the most recent
50. Set toNULLto show the full history.- xlab, ylab, main
Optional axis and title labels. When omitted, sensible defaults are chosen from
type.- ...
Additional arguments passed to
theme_bridgr().
Examples
gdp_growth <- tsbox::ts_pc(gdp)
#> [value]: 'values'
#> [value]: 'values'
gdp_growth <- tsbox::ts_na_omit(gdp_growth)
#> [value]: 'values'
model <- mf_model(
target = gdp_growth,
indic = baro,
indic_predict = "auto.arima",
indic_aggregators = "mean",
h = 1
)
plot(model)
