A function that computes predictions based on a object of class bgvar
.
# S3 method for bgvar
predict(object, ..., fhorz = 8, save.store = FALSE, verbose = TRUE)
an object of class bgvar
.
additional arguments.
the forecast horizon.
If set to TRUE
the full distribution is returned. Default is set to FALSE
in order to save storage.
If set to FALSE
it suppresses printing messages to the console.
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.
# 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