Forecast the target variable from a fitted mf_model() object.
Arguments
- object
A
"mf_model"object returned bymf_model().- xreg
Optional future regressors in a
tsbox::ts_boxable()format. When omitted, the forecast regressor set stored insideobjectis used. When supplied,xregmust contain the same non-target regressors used when fitting the bridge equation.- level
Prediction interval levels used when the model was estimated with
se = TRUE. When uncertainty is unavailable,forecast()still returns these,lower, anduppercomponents, filled withNA.- ...
Unused.
- x
A
"mf_model_forecast"object returned byforecast.mf_model().
Value
An object of class "mf_model_forecast" and "forecast" containing
point forecasts, predictive uncertainty summaries, the
target-period regressors used for forecasting, and optional full-system
bootstrap metadata.
x, invisibly.
Details
In recursive bridge forecasts, uncertainty typically increases with
horizon because later forecast steps depend on forecasted rather than
observed target lags and, when needed, completed indicator paths. Under the
package's residual-resampling and full-system bootstrap workflows, those
simulated disturbances accumulate across steps, so standard errors and
interval widths can widen as the forecast horizon extends. The
uncertainty-and-scenarios vignette includes one worked example that trims
forecast rows by an acceptable prediction-interval width.
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
)
forecast(model)
#> Mixed-frequency forecast
#> -----------------------------------
#> Target series: gdp_growth
#> Forecast horizon: 1
#> Uncertainty: point forecast only
#> -----------------------------------
#> time mean
#> 1 2023-01-01 0.161
