R/intermittent_ata.r
forecast.intermittentATA.Rd
Forecast a model from the fable intermittentATA model
# S3 method for intermittentATA
forecast(
object,
new_data,
h = NULL,
ci_level = 95,
negative_forecast = TRUE,
onestep = FALSE,
...
)
The time series model used to produce the forecasts
A `tsibble` containing future information used to forecast.
The forecast horison (can be used instead of `new_data` for regular time series with no exogenous regressors).
Confidence Interval levels for forecasting. Default value is 95.
Negative values are allowed for forecasting. Default value is TRUE. If FALSE, all negative values for forecasting are set to 0.
Default is FALSE. if TRUE, the dynamic forecast strategy uses a one-step model multiple times `h` forecast horizon) where the prediction for the prior time step is used as an input for making a prediction on the following time step.
Other arguments
A vector of fitted residuals.
library(intermittentATA)
as_tsibble(fmcgData) %>%
model(crostonata = intermittentATA(value ~ d_trend(type = "M", parQ = 1) + i_trend("A") + intermittent("croston"))) %>% forecast(h=6)
#> # A fable: 6 x 4 [1M]
#> # Key: .model [1]
#> .model index value .mean
#> <chr> <mth> <dist> <dbl>
#> 1 crostonata 2019 Jan 0.1693098 0.169
#> 2 crostonata 2019 Feb 0.1693098 0.169
#> 3 crostonata 2019 Mar 0.1693098 0.169
#> 4 crostonata 2019 Apr 0.1693098 0.169
#> 5 crostonata 2019 May 0.1693098 0.169
#> 6 crostonata 2019 Jun 0.1693098 0.169