forecast.bridge | R Documentation |
bridge
objectThis function is used to forecast the target variable using the fitted bridge
model.
## S3 method for class 'bridge'
forecast(object, xreg = NULL, ...)
object |
A |
xreg |
A |
... |
Additional arguments to be passed to the forecast function. Ignored at the moment. |
An object of class "forecast
".
An object of class "forecast"
is a list usually containing at least
the following elements:
model |
A list containing information about the fitted model |
method |
The name of the forecasting method as a character string |
mean |
Point forecasts as a time series |
lower |
Lower limits for prediction intervals |
upper |
Upper limits for prediction intervals |
level |
The confidence values associated with the prediction intervals |
x |
The original time series
(either |
residuals |
Residuals from the fitted model. For models with additive errors, the residuals will be x minus the fitted values. |
fitted |
Fitted values (one-step forecasts) |
forecast_set |
The forecast set with the forecasted indicator variables used to calculate the forecast of the target variable. |
library(bridgr)
# Example usage
target_series <- suppressMessages(tsbox::ts_tbl(data.frame(
time = seq(as.Date("2020-01-01"), as.Date("2022-12-01"), by = "quarter"),
value = rnorm(12)
)))
indic_series <- suppressMessages(tsbox::ts_tbl(data.frame(
time = seq(as.Date("2020-01-01"), as.Date("2023-01-01"), by = "month"),
value = rnorm(37)
)))
bridge_model <- suppressMessages(bridge(
target = target_series,
indic = indic_series,
indic_predict = "mean",
indic_aggregators = "mean",
indic_lags = 2,
target_lags = 1,
h = 1
))
# Forecasting using the bridge model
fcst <- forecast(bridge_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.