Skip to contents

Performs the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.

Usage

# S3 method for class 'BVARPANEL'
forecast_poos_recursively(model_spec, poos_spec, show_progress = TRUE)

Arguments

model_spec

an object of class BVARPANEL generated using the specify_bvarPANEL function and containing the Bayesian Panel VAR model specification.

poos_spec

an object of class POOSForecastSetup containing specification of the recursive pseudo-out-of-sample forecasting exercise using expanding window samples.

show_progress

a logical value, if TRUE the estimation progress bar is visible

Value

An object of class ForecastsPOOS containing the outcome of Bayesian recursive pseudo-out-of-sample forecasting exercise using expanding window samples. The object is a list with forecasting_sample elements, where forecasting_sample is equal to the sample size less the maximum of horizons and the training_sample plus one. Each element of the list is an object of class ForecastsPANEL containing the forecasts for each country, see forecast.PosteriorBVARPANEL.

Author

Tomasz Woźniak wozniak.tom@pm.me

Examples

spec = specify_bvarPANEL$new(ilo_dynamic_panel)   # specify the model
poos = specify_poosf_exercise$new(                # specify the forecasting exercise
         spec, 
         S = 10,                                  # use at least S = 5000
         S_burn = 5,                              # use at least S_burn = 1000
         horizons = 1:2,
         training_sample = 28
       )   
fore = forecast_poos_recursively(spec, poos)      # execute the forecasting exercise
#> **************************************************|
#>  bpvars: Forecasting with Bayesian Panel VARs     |
#> **************************************************|
#>  Recursive pseudo-out-of-sample forecasting using
#>          expanding window samples.
#>  Press Esc to interrupt the computations
#> **************************************************|
#>  Step 1: Estimate a model for a full sample to get
#>          starting values for subsequent steps.
#>  Step 2: Recursive pseudo out-of-sample
#>          forecasting performed for 3 samples.
#> **************************************************|
plot(fore[[1]], "POL")                         # plot forecasts for the first estimation samples