Package: bsvars 3.2.0.9000

Tomasz Woźniak

bsvars: Bayesian Estimation of Structural Vector Autoregressive Models

Provides fast and efficient procedures for Bayesian analysis of Structural Vector Autoregressions. This package estimates a wide range of models, including homo-, heteroskedastic, and non-normal specifications. Structural models can be identified by adjustable exclusion restrictions, time-varying volatility, or non-normality. They all include a flexible three-level equation-specific local-global hierarchical prior distribution for the estimated level of shrinkage for autoregressive and structural parameters. Additionally, the package facilitates predictive and structural analyses such as impulse responses, forecast error variance and historical decompositions, forecasting, verification of heteroskedasticity, non-normality, and hypotheses on autoregressive parameters, as well as analyses of structural shocks, volatilities, and fitted values. Beautiful plots, informative summary functions, and extensive documentation including the vignette by Woźniak (2024) <doi:10.48550/arXiv.2410.15090> complement all this. The implemented techniques align closely with those presented in Lütkepohl, Shang, Uzeda, & Woźniak (2024) <doi:10.48550/arXiv.2404.11057>, Lütkepohl & Woźniak (2020) <doi:10.1016/j.jedc.2020.103862>, and Song & Woźniak (2021) <doi:10.1093/acrefore/9780190625979.013.174>. The 'bsvars' package is aligned regarding objects, workflows, and code structure with the R package 'bsvarSIGNs' by Wang & Woźniak (2024) <doi:10.32614/CRAN.package.bsvarSIGNs>, and they constitute an integrated toolset.

Authors:Tomasz Woźniak [aut, cre]

bsvars_3.2.0.9000.tar.gz
bsvars_3.2.0.9000.zip(r-4.5)bsvars_3.2.0.9000.zip(r-4.4)bsvars_3.2.0.9000.zip(r-4.3)
bsvars_3.2.0.9000.tgz(r-4.4-x86_64)bsvars_3.2.0.9000.tgz(r-4.4-arm64)bsvars_3.2.0.9000.tgz(r-4.3-x86_64)bsvars_3.2.0.9000.tgz(r-4.3-arm64)
bsvars_3.2.0.9000.tar.gz(r-4.5-noble)bsvars_3.2.0.9000.tar.gz(r-4.4-noble)
bsvars_3.2.0.9000.tgz(r-4.4-emscripten)bsvars_3.2.0.9000.tgz(r-4.3-emscripten)
bsvars.pdf |bsvars.html
bsvars/json (API)
NEWS

# Install 'bsvars' in R:
install.packages('bsvars', repos = c('https://bsvars.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/bsvars/bsvars/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:
  • us_fiscal_cond_forecasts - A matrix to be used in a conditional forecasting example including the projected values of total tax revenue that are projected to increase at an average quarterly sample growth rate. The other two columns are filled with 'NA' values, which implies that the future values of the corresponding endogenous variables, namely government spending and GDP, will be forecasted given the provided projected values of total tax revenue. The matrix includes future values for the forecast horizon of two years for the US fiscal model for the period 2024 Q3 - 2026 Q2.
  • us_fiscal_ex - A 3-variable system of exogenous variables for the US fiscal model for the period 1948 Q1 - 2024 Q2
  • us_fiscal_ex_forecasts - A 3-variable system of exogenous variables' future values for the forecast horizon of two years for the US fiscal model for the period 2024 Q3 - 2026 Q2
  • us_fiscal_lsuw - A 3-variable US fiscal system for the period 1948 Q1 - 2024 Q2

On CRAN:

bayesian-inferenceeconometricsvector-autoregression

7.65 score 44 stars 1 packages 27 scripts 865 downloads 36 exports 9 dependencies

Last updated 2 days agofrom:4d0b43e6ba. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 18 2024
R-4.5-win-x86_64OKNov 18 2024
R-4.5-linux-x86_64OKNov 18 2024
R-4.4-win-x86_64OKNov 18 2024
R-4.4-mac-x86_64OKNov 18 2024
R-4.4-mac-aarch64OKNov 18 2024
R-4.3-win-x86_64OKNov 18 2024
R-4.3-mac-x86_64OKNov 18 2024
R-4.3-mac-aarch64OKNov 18 2024

Exports:compute_conditional_sdcompute_fitted_valuescompute_historical_decompositionscompute_impulse_responsescompute_regime_probabilitiescompute_structural_shockscompute_variance_decompositionsestimateforecastnormalise_posteriorplot_ribbonspecify_bsvarspecify_bsvar_mixspecify_bsvar_mshspecify_bsvar_svspecify_bsvar_tspecify_data_matricesspecify_identification_bsvarsspecify_posterior_bsvarspecify_posterior_bsvar_mixspecify_posterior_bsvar_mshspecify_posterior_bsvar_svspecify_posterior_bsvar_tspecify_prior_bsvarspecify_prior_bsvar_mixspecify_prior_bsvar_mshspecify_prior_bsvar_svspecify_prior_bsvar_tspecify_starting_values_bsvarspecify_starting_values_bsvar_mixspecify_starting_values_bsvar_mshspecify_starting_values_bsvar_svspecify_starting_values_bsvar_tverify_autoregressionverify_identificationverify_volatility

Dependencies:codaGIGrvglatticeR6RcppRcppArmadilloRcppProgressRcppTNstochvol

Fast and Efficient Bayesian Analysis of Structural Vector Autoregressions Using the R package bsvars

Rendered frombsvars_vignette.Rnwusingknitr::knitron Nov 18 2024.

Last update: 2024-10-19
Started: 2024-10-19

Readme and manuals

Help Manual

Help pageTopics
Bayesian Estimation of Structural Vector Autoregressive Modelsbsvars-package bsvars
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd.PosteriorBSVAR
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd.PosteriorBSVARMIX
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd.PosteriorBSVARMSH
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd.PosteriorBSVARSV
Computes posterior draws of structural shock conditional standard deviationscompute_conditional_sd.PosteriorBSVART
Computes posterior draws from data predictive densitycompute_fitted_values
Computes posterior draws from data predictive densitycompute_fitted_values.PosteriorBSVAR
Computes posterior draws from data predictive densitycompute_fitted_values.PosteriorBSVARMIX
Computes posterior draws from data predictive densitycompute_fitted_values.PosteriorBSVARMSH
Computes posterior draws from data predictive densitycompute_fitted_values.PosteriorBSVARSV
Computes posterior draws from data predictive densitycompute_fitted_values.PosteriorBSVART
Computes posterior draws of historical decompositionscompute_historical_decompositions
Computes posterior draws of historical decompositionscompute_historical_decompositions.PosteriorBSVAR
Computes posterior draws of historical decompositionscompute_historical_decompositions.PosteriorBSVARMIX
Computes posterior draws of historical decompositionscompute_historical_decompositions.PosteriorBSVARMSH
Computes posterior draws of historical decompositionscompute_historical_decompositions.PosteriorBSVARSV
Computes posterior draws of historical decompositionscompute_historical_decompositions.PosteriorBSVART
Computes posterior draws of impulse responsescompute_impulse_responses
Computes posterior draws of impulse responsescompute_impulse_responses.PosteriorBSVAR
Computes posterior draws of impulse responsescompute_impulse_responses.PosteriorBSVARMIX
Computes posterior draws of impulse responsescompute_impulse_responses.PosteriorBSVARMSH
Computes posterior draws of impulse responsescompute_impulse_responses.PosteriorBSVARSV
Computes posterior draws of impulse responsescompute_impulse_responses.PosteriorBSVART
Computes posterior draws of regime probabilitiescompute_regime_probabilities
Computes posterior draws of regime probabilitiescompute_regime_probabilities.PosteriorBSVARMIX
Computes posterior draws of regime probabilitiescompute_regime_probabilities.PosteriorBSVARMSH
Computes posterior draws of structural shockscompute_structural_shocks
Computes posterior draws of structural shockscompute_structural_shocks.PosteriorBSVAR
Computes posterior draws of structural shockscompute_structural_shocks.PosteriorBSVARMIX
Computes posterior draws of structural shockscompute_structural_shocks.PosteriorBSVARMSH
Computes posterior draws of structural shockscompute_structural_shocks.PosteriorBSVARSV
Computes posterior draws of structural shockscompute_structural_shocks.PosteriorBSVART
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions.PosteriorBSVAR
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions.PosteriorBSVARMIX
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions.PosteriorBSVARMSH
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions.PosteriorBSVARSV
Computes posterior draws of the forecast error variance decompositioncompute_variance_decompositions.PosteriorBSVART
Bayesian estimation of Structural Vector Autoregressions via Gibbs samplerestimate
Bayesian estimation of a homoskedastic Structural Vector Autoregression via Gibbs samplerestimate.BSVAR
Bayesian estimation of a Structural Vector Autoregression with shocks following a finite mixture of normal components via Gibbs samplerestimate.BSVARMIX
Bayesian estimation of a Structural Vector Autoregression with Markov-switching heteroskedasticity via Gibbs samplerestimate.BSVARMSH
Bayesian estimation of a Structural Vector Autoregression with Stochastic Volatility heteroskedasticity via Gibbs samplerestimate.BSVARSV
Bayesian estimation of a homoskedastic Structural Vector Autoregression with t-distributed structural shocks via Gibbs samplerestimate.BSVART
Bayesian estimation of a homoskedastic Structural Vector Autoregression via Gibbs samplerestimate.PosteriorBSVAR
Bayesian estimation of a Structural Vector Autoregression with shocks following a finite mixture of normal components via Gibbs samplerestimate.PosteriorBSVARMIX
Bayesian estimation of a Structural Vector Autoregression with Markov-switching heteroskedasticity via Gibbs samplerestimate.PosteriorBSVARMSH
Bayesian estimation of a Structural Vector Autoregression with Stochastic Volatility heteroskedasticity via Gibbs samplerestimate.PosteriorBSVARSV
Bayesian estimation of a homoskedastic Structural Vector Autoregression with t-distributed structural shocks via Gibbs samplerestimate.PosteriorBSVART
Forecasting using Structural Vector Autoregressionforecast
Forecasting using Structural Vector Autoregressionforecast.PosteriorBSVAR
Forecasting using Structural Vector Autoregressionforecast.PosteriorBSVARMIX
Forecasting using Structural Vector Autoregressionforecast.PosteriorBSVARMSH
Forecasting using Structural Vector Autoregressionforecast.PosteriorBSVARSV
Forecasting using Structural Vector Autoregressionforecast.PosteriorBSVART
Waggoner & Zha (2003) row signs normalisation of the posterior draws for matrix Bnormalise_posterior
Plots the median and an interval between two specified percentiles for a sequence of 'K' random variablesplot_ribbon
Plots fitted values of dependent variablesplot.Forecasts
Plots forecast error variance decompositionsplot.PosteriorFEVD
Plots fitted values of dependent variablesplot.PosteriorFitted
Plots historical decompositionsplot.PosteriorHD
Plots impulse responsesplot.PosteriorIR
Plots estimated regime probabilitiesplot.PosteriorRegimePr
Plots structural shocksplot.PosteriorShocks
Plots structural shocks' conditional standard deviationsplot.PosteriorSigma
R6 Class representing the specification of the homoskedastic BSVAR modelspecify_bsvar
R6 Class representing the specification of the BSVAR model with a zero-mean mixture of normals model for structural shocks.specify_bsvar_mix
R6 Class representing the specification of the BSVAR model with Markov Switching Heteroskedasticity.specify_bsvar_msh
R6 Class representing the specification of the BSVAR model with Stochastic Volatility heteroskedasticity.specify_bsvar_sv
R6 Class representing the specification of the BSVAR model with t-distributed structural shocks.specify_bsvar_t
R6 Class Representing DataMatricesBSVARspecify_data_matrices
R6 Class Representing IdentificationBSVARsspecify_identification_bsvars
R6 Class Representing PosteriorBSVARspecify_posterior_bsvar
R6 Class Representing PosteriorBSVARMIXspecify_posterior_bsvar_mix
R6 Class Representing PosteriorBSVARMSHspecify_posterior_bsvar_msh
R6 Class Representing PosteriorBSVARSVspecify_posterior_bsvar_sv
R6 Class Representing PosteriorBSVARTspecify_posterior_bsvar_t
R6 Class Representing PriorBSVARspecify_prior_bsvar
R6 Class Representing PriorBSVARMIXspecify_prior_bsvar_mix
R6 Class Representing PriorBSVARMSHspecify_prior_bsvar_msh
R6 Class Representing PriorBSVARSVspecify_prior_bsvar_sv
R6 Class Representing PriorBSVARTspecify_prior_bsvar_t
R6 Class Representing StartingValuesBSVARspecify_starting_values_bsvar
R6 Class Representing StartingValuesBSVARMIXspecify_starting_values_bsvar_mix
R6 Class Representing StartingValuesBSVARMSHspecify_starting_values_bsvar_msh
R6 Class Representing StartingValuesBSVARSVspecify_starting_values_bsvar_sv
R6 Class Representing StartingValuesBSVARTspecify_starting_values_bsvar_t
Provides posterior summary of Forecastssummary.Forecasts
Provides posterior summary of homoskedastic Structural VAR estimationsummary.PosteriorBSVAR
Provides posterior summary of non-normal Structural VAR estimationsummary.PosteriorBSVARMIX
Provides posterior summary of heteroskedastic Structural VAR estimationsummary.PosteriorBSVARMSH
Provides posterior summary of heteroskedastic Structural VAR estimationsummary.PosteriorBSVARSV
Provides posterior summary of Structural VAR with t-distributed shocks estimationsummary.PosteriorBSVART
Provides posterior summary of forecast error variance decompositionssummary.PosteriorFEVD
Provides posterior summary of variables' fitted valuessummary.PosteriorFitted
Provides posterior summary of historical decompositionssummary.PosteriorHD
Provides posterior summary of impulse responsessummary.PosteriorIR
Provides posterior summary of regime probabilitiessummary.PosteriorRegimePr
Provides posterior summary of structural shockssummary.PosteriorShocks
Provides posterior summary of structural shocks' conditional standard deviationssummary.PosteriorSigma
Provides summary of verifying hypotheses about autoregressive parameterssummary.SDDRautoregression
Provides summary of verifying shocks' normalitysummary.SDDRidMIX
Provides summary of verifying homoskedasticitysummary.SDDRidMSH
Provides summary of verifying homoskedasticitysummary.SDDRidSV
Provides summary of verifying shocks' normalitysummary.SDDRidT
Provides summary of verifying homoskedasticitysummary.SDDRvolatility
A matrix to be used in a conditional forecasting example including the projected values of total tax revenue that are projected to increase at an average quarterly sample growth rate. The other two columns are filled with 'NA' values, which implies that the future values of the corresponding endogenous variables, namely government spending and GDP, will be forecasted given the provided projected values of total tax revenue. The matrix includes future values for the forecast horizon of two years for the US fiscal model for the period 2024 Q3 - 2026 Q2.us_fiscal_cond_forecasts
A 3-variable system of exogenous variables for the US fiscal model for the period 1948 Q1 - 2024 Q2us_fiscal_ex
A 3-variable system of exogenous variables' future values for the forecast horizon of two years for the US fiscal model for the period 2024 Q3 - 2026 Q2us_fiscal_ex_forecasts
A 3-variable US fiscal system for the period 1948 Q1 - 2024 Q2us_fiscal_lsuw
Verifies hypotheses involving autoregressive parametersverify_autoregression
Verifies hypotheses involving autoregressive parametersverify_autoregression.PosteriorBSVAR
Verifies hypotheses involving autoregressive parametersverify_autoregression.PosteriorBSVARMIX
Verifies hypotheses involving autoregressive parametersverify_autoregression.PosteriorBSVARMSH
Verifies hypotheses involving autoregressive parametersverify_autoregression.PosteriorBSVARSV
Verifies hypotheses involving autoregressive parametersverify_autoregression.PosteriorBSVART
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification.PosteriorBSVAR
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification.PosteriorBSVARMIX
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification.PosteriorBSVARMSH
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification.PosteriorBSVARSV
Verifies identification through heteroskedasticity or non-normality of of structural shocksverify_identification.PosteriorBSVART
Verifies heteroskedasticity of structural shocks equation by equationverify_volatility
Verifies heteroskedasticity of structural shocks equation by equationverify_volatility.PosteriorBSVAR
Verifies heteroskedasticity of structural shocks equation by equationverify_volatility.PosteriorBSVARMIX
Verifies heteroskedasticity of structural shocks equation by equationverify_volatility.PosteriorBSVARMSH
Verifies heteroskedasticity of structural shocks equation by equationverify_volatility.PosteriorBSVARSV