Skip to contents

This function conducts expanding window forecasting.

Usage

forecast_expand(object, n_ahead, y_test, num_thread = 1, ...)

# S3 method for class 'olsmod'
forecast_expand(object, n_ahead, y_test, num_thread = 1, ...)

# S3 method for class 'normaliw'
forecast_expand(object, n_ahead, y_test, num_thread = 1, use_fit = TRUE, ...)

# S3 method for class 'ldltmod'
forecast_expand(
  object,
  n_ahead,
  y_test,
  num_thread = 1,
  level = 0.05,
  stable = FALSE,
  sparse = FALSE,
  med = FALSE,
  lpl = FALSE,
  use_fit = TRUE,
  ...
)

# S3 method for class 'svmod'
forecast_expand(
  object,
  n_ahead,
  y_test,
  num_thread = 1,
  level = 0.05,
  use_sv = TRUE,
  stable = FALSE,
  sparse = FALSE,
  med = FALSE,
  lpl = FALSE,
  use_fit = TRUE,
  ...
)

Arguments

object

Model object

n_ahead

Step to forecast in rolling window scheme

y_test

Test data to be compared. Use divide_ts() if you don't have separate evaluation dataset.

num_thread

[Experimental] Number of threads

...

Additional arguments.

use_fit

[Experimental] Use object result for the first window. By default, TRUE.

level

Specify alpha of confidence interval level 100(1 - alpha) percentage. By default, .05.

stable

[Experimental] Filter only stable coefficient draws in MCMC records.

sparse

[Experimental] Apply restriction. By default, FALSE.

med

[Experimental] If TRUE, use median of forecast draws instead of mean (default).

lpl

[Experimental] Compute log-predictive likelihood (LPL). By default, FALSE.

use_sv

Use SV term

Value

predbvhar_expand class

Details

Expanding windows forecasting fixes the starting period. It moves the window ahead and forecast h-ahead in y_test set.

References

Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and practice (3rd ed.). OTEXTS. https://otexts.com/fpp3/