Learn R Programming

sstvars (version 1.1.0)

plot.stvarpred: Predict method for class 'stvar' objects

Description

predict.stvar is a predict method for class 'stvar' objects.

Usage

# S3 method for stvarpred
plot(x, ..., nt, trans_weights = TRUE)

# S3 method for stvar predict( object, ..., nsteps, nsim = 1000, pi = c(0.95, 0.8), pred_type = c("mean", "median"), exo_weights = NULL )

# S3 method for stvarpred print(x, ..., digits = 2)

Value

Returns a class 'stvarpred' object containing, among the specifications,...

$pred

Point forecasts

$pred_ints

Prediction intervals, as [, , d].

$trans_pred

Point forecasts for the transition weights

$trans_pred_ints

Individual prediction intervals for transition weights, as [, , m], m=1,..,M.

Arguments

x

object of class 'stvarpred'

...

currently not used.

nt

a positive integer specifying the number of observations to be plotted along with the forecast.

trans_weights

should forecasts for transition weights be plotted?

object

an object of class 'stvar'.

nsteps

how many steps ahead should be predicted?

nsim

to how many independent simulations should the forecast be based on?

pi

a numeric vector specifying the confidence levels of the prediction intervals.

pred_type

should the pointforecast be based on sample "median" or "mean"?

exo_weights

if weight_function="exogenous", provide a size \((nsteps x M)\) matrix of exogenous transition weights for the regimes: [step, m] for \(step\) steps ahead and regime \(m\) weight. Ignored if weight_function!="exogenous".

digits

the number of decimals to print

Functions

  • plot(stvarpred): predict method

  • print(stvarpred): print method

Details

The forecasts are computed by simulating multiple sample paths of the future observations and using the sample medians or means as point forecasts and empirical quantiles as prediction intervals.

References

  • Anderson H., Vahid F. 1998. Testing multiple equation systems for common nonlinear components. Journal of Econometrics, 84:1, 1-36.

  • Hansen B.E. 1994. Autoregressive Conditional Density estimation. Journal of Econometrics, 35:3, 705-730.

  • Kheifets I.L., Saikkonen P.J. 2020. Stationarity and ergodicity of Vector STAR models. International Economic Review, 35:3, 407-414.

  • Lanne M., Virolainen S. 2024. A Gaussian smooth transition vector autoregressive model: An application to the macroeconomic effects of severe weather shocks. Unpublished working paper, available as arXiv:2403.14216.

  • Lütkepohl H. 2005. New Introduction to Multiple Time Series Analysis, Springer.

  • McElroy T. 2017. Computation of vector ARMA autocovariances. Statistics and Probability Letters, 124, 92-96.

  • Kilian L., Lütkepohl H. 20017. Structural Vector Autoregressive Analysis. 1st edition. Cambridge University Press, Cambridge.

  • Tsay R. 1998. Testing and Modeling Multivariate Threshold Models. Journal of the American Statistical Association, 93:443, 1188-1202.

  • Virolainen S. 2024. Identification by non-Gaussianity in structural threshold and smooth transition vector autoregressive models. Unpublished working paper, available as arXiv:2404.19707.

See Also

simulate.stvar

Examples

Run this code
 # p=2, M=2, d=2, Gaussian relative dens weights
 theta_222relg <- c(0.356914, 0.107436, 0.356386, 0.08633, 0.13996, 0.035172,
   -0.164575, 0.386816, 0.451675, 0.013086, 0.227882, 0.336084, 0.239257, 0.024173,
   -0.021209, 0.707502, 0.063322, 0.027287, 0.009182, 0.197066, 0.205831, 0.005157,
   0.025877, 1.092094, -0.009327, 0.116449, 0.592446)
 mod222relg <- STVAR(data=gdpdef, p=2, M=2, d=2, params=theta_222relg,
   weight_function="relative_dens")

 # Predict 10 steps ahead, point forecast based on the conditional
 # mean and 90% prediction intervals; prediction based on 100 sample paths:
 pred1 <- predict(mod222relg, nsteps=10, nsim=100, pi=0.9, pred_type="mean")
 pred1
 plot(pred1)

 # Predict 7 steps ahead, point forecast based on median and  90%, 80%,
 # and 70% prediction intervals; prediction based on 80 sample paths:
 pred2 <- predict(mod222relg, nsteps=7, nsim=80, pi=c(0.9, 0.8, 0.7),
  pred_type="median")
 pred2
 plot(pred2)

Run the code above in your browser using DataLab