Skip to contents

Produces forecasts from a trained model.

Usage

# S3 method for INGARCH
forecast(object, new_data, ...)

Arguments

object

A model for which forecasts are required.

new_data

Tsibble, it has to contains the time points and exogenous regressors to produce forecasts for.

...

Other arguments passed to methods

Value

A list of forecasts.

Details

Predict future observations based on a fitted GLM-type model for time series of counts. For 1 step ahead, it returns parametric forecast, based on the 'distr' param especified distribution, for multiples steps forecast, the distribution is not know analytically, so it uses a parametric bootstrap

Examples

 # 1 step ahead parametric forecast
tsibbledata::aus_production |>
  fabletools::model(manual_ing = INGARCH(Beer ~ pq(1,1) + PQ(1,1))) |>
  dplyr::select(manual_ing) |>
  fabletools::forecast(h = 1)
#> # A fable: 1 x 4 [1Q]
#> # Key:     .model [1]
#>   .model     Quarter      Beer .mean
#>   <chr>        <qtr>    <dist> <dbl>
#> 1 manual_ing 2010 Q3 Pois(411)  411.

# Multiples steap ahead parametric bootstrap forecast
tsibbledata::aus_production |>
  fabletools::model(manual_ing = INGARCH(Beer ~ pq(1,1) + PQ(1,1))) |>
  dplyr::select(manual_ing) |>
  fabletools::forecast(h = 4)
#> # A fable: 4 x 4 [1Q]
#> # Key:     .model [1]
#>   .model     Quarter         Beer .mean
#>   <chr>        <qtr>       <dist> <dbl>
#> 1 manual_ing 2010 Q3 sample[1000]  410.
#> 2 manual_ing 2010 Q4 sample[1000]  411.
#> 3 manual_ing 2011 Q1 sample[1000]  409.
#> 4 manual_ing 2011 Q2 sample[1000]  407.