Envelope function that forecasts arima model

arima_forecastor(
  fit,
  test_sample = NA,
  predicted = "",
  predicted_ = "",
  options = "",
  predictors = "",
  h = 1,
  frequency = 1
)

Arguments

fit

fitted arima model

test_sample

tsibble with predictors for test sample

predicted

name of all the predicted variables. Not used as is determined by the fit.

predicted_

name of the perdicted variable. Not used as is determined by the fit.

options

character with options separated by comma not supparted

predictors

character with predictors separated by plus or comma, no predictors by default

h

forecasting horizon

frequency

time series frequency may be it is needed for forecasting with regressors, may check later

Value

forecast object

Details

Envelope function that forecasts arima model.

Examples

train_sample = tsibble::tsibble(date = lubridate::ymd("2017-01-01") + months(0:99), y = arima.sim(n = 100, model = list(ar = 0.7)), x = 1:100)
#> Using `date` as index variable.
fit = arima_estimator(train_sample, "y", "p=2,d=0,q=0", "x")
#> Error in stats::arima(x = x, order = order, seasonal = seasonal, xreg = xreg, : #> lengths of 'x' and 'xreg' do not match
test_sample = tsibble::tsibble(date = lubridate::ymd("2030-01-01") + months(0:1), x = 5:6)
#> Using `date` as index variable.
arima_forecastor(fit, test_sample, predictors = "x", h = 2, frequency = 12)
#> [1] NA