Learn R Programming

BGVAR (version 2.0.0)

predict.bgvar: Compute predictions

Description

A function that computes predictions based on a object of class bgvar.

Usage

# S3 method for bgvar
predict(object, ..., fhorz = 8, save.store = FALSE, verbose = TRUE)

Arguments

object

an object of class bgvar.

...

additional arguments.

fhorz

the forecast horizon.

save.store

If set to TRUE the full distribution is returned. Default is set to FALSE in order to save storage.

verbose

If set to FALSE it suppresses printing messages to the console.

Value

Returns an object of class bgvar.pred with the following elements

  • fcast is a K times fhorz times 5-dimensional array that contains 16%th, 25%th, 50%th, 75%th and 84% percentiles of the posterior predictive distribution.

  • xglobal is a matrix object of dimension T times N (T # of observations, K # of variables in the system).

  • fhorz specified forecast horizon.

  • lps.stats is an array object of dimension K times 2 times fhorz and contains the mean and standard deviation of the log-predictive scores for each variable and each forecast horizon.

  • hold.out if h is not set to zero, this contains the hold-out sample.

Examples

Run this code
# NOT RUN {
library(BGVAR)
data(eerData)
model.ssvs <- bgvar(Data=eerData,W=W.trade0012,plag=1,saves=100,burns=100,
                    prior="SSVS")
fcast <- predict(model.ssvs, fhorz=8)
# }

Run the code above in your browser using DataLab