BVAR
Toolkit for the estimation of hierarchical Bayesian vector autoregressions. Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza & Primiceri (2015). Allows for the computation of impulse responses and forecasts and provides functionality for assessing results.
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 9 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
3 of 7 committers (42.9%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Keywords
Repository
Toolkit for the estimation of hierarchical Bayesian vector autoregressions. Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza & Primiceri (2015). Allows for the computation of impulse responses and forecasts and provides functionality for assessing results.
Basic Info
- Host: GitHub
- Owner: nk027
- License: other
- Language: R
- Default Branch: master
- Homepage: https://cran.r-project.org/package=BVAR
- Size: 5.72 MB
Statistics
- Stars: 57
- Watchers: 3
- Forks: 22
- Open Issues: 22
- Releases: 13
Topics
Metadata Files
README.md
BVAR: Hierarchical Bayesian Vector Autoregression
Estimation of hierarchical Bayesian vector autoregressive models following Kuschnig & Vashold (2021). Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza & Primiceri (2015). Functions to calculate forecasts, and compute and identify impulse responses and forecast error variance decompositions are available. Several methods to print, plot and summarise results facilitate analysis.
Installation
BVAR is available on CRAN. The development version can be installed from GitHub.
r
install.packages("BVAR")
devtools::install_github("nk027/BVAR")
Usage
The main function to perform hierarchical Bayesian VAR estimation is bvar(). Calls can be customised with regard to the sampling (e.g. via n_draw, or see bv_mh()) or with regard to the priors (see bv_priors()). Forecasts and impulse responses can be computed at runtime, or afterwards (see predict() and irf()). Identification of sign restrictions can be achieved recursively, via sign restrictions, or via zero and sign restrictions.
Analysis is facilitated by a variety of standard methods. The default plot() method provides trace and density plots of hyperparameters and optionally coefficients. Impulse responses and forecasts can easily be assessed with the provided plot() methods. Other available methods include summary(), fitted(), residuals(), coef(), vcov() and density(). Note that BVAR generates draws from the posterior -- all methods include functionality to access this distributional information. Information can be obtained directly or more conveniently using the BVARverse package.
BVAR comes with the FRED-MD and FRED-QD datasets (McCracken and Ng, 2016). They can be accessed using data("fred_md") or data("fred_qd") respectively. The dataset is licensed under a modified ODC-BY 1.0 license, that is available in the provided LICENSE file.
Demonstration
``` r
Load the package
library("BVAR")
Access a subset of the fred_qd dataset
data <- fred_qd[, c("GDPC1", "CPIAUCSL", "UNRATE", "FEDFUNDS")]
Transform it to be stationary
data <- fred_transform(data, codes = c(5, 5, 5, 1), lag = 4)
Estimate using default priors and MH step
x <- bvar(data, lags = 1)
Check convergence via trace and density plots
plot(x)
Calculate and store forecasts and impulse responses
predict(x) <- predict(x, horizon = 20) irf(x) <- irf(x, horizon = 20, identification = TRUE)
Plot forecasts and impulse responses
plot(predict(x)) plot(irf(x)) ```
References
Nikolas Kuschnig and Lukas Vashold (2021). BVAR: Bayesian Vector Autoregressions with Hierarchical Prior Selection in R. Journal of Statistical Software, 14, 1-27, DOI: 10.18637/jss.v100.i14.
Domenico Giannone, Michele Lenza and Giorgio E. Primiceri (2015). Prior Selection for Vector Autoregressions. The Review of Economics and Statistics, 97:2, 436-451, DOI: 10.1162/RESTa00483.
Michael W. McCracken and Serena Ng (2016). FRED-MD: A Monthly Database for Macroeconomic Research. Journal of Business & Economic Statistics, 34:4, 574-589, DOI: 10.1080/07350015.2015.1086655.
Owner
- Name: Nikolas Kuschnig
- Login: nk027
- Kind: user
- Location: Vienna
- Company: Economics, WU
- Website: kuschnig.eu
- Repositories: 21
- Profile: https://github.com/nk027
GitHub Events
Total
- Issues event: 4
- Watch event: 7
- Issue comment event: 8
- Pull request event: 1
- Fork event: 1
Last Year
- Issues event: 4
- Watch event: 7
- Issue comment event: 8
- Pull request event: 1
- Fork event: 1
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Nikolas Kuschnig | k****s@g****m | 211 |
| oDNAudio | l****d@g****t | 132 |
| Nikolas Kuschnig | n****g@w****t | 121 |
| Nikolas Kuschnig | n****i@w****t | 56 |
| oDNAudio | 4****o | 8 |
| Lukas | u****r@M****l | 1 |
| Vashold | l****d@a****t | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 96
- Total pull requests: 3
- Average time to close issues: about 2 months
- Average time to close pull requests: about 6 hours
- Total issue authors: 17
- Total pull request authors: 2
- Average comments per issue: 1.99
- Average comments per pull request: 0.33
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 4
- Pull requests: 2
- Average time to close issues: 7 days
- Average time to close pull requests: N/A
- Issue authors: 4
- Pull request authors: 1
- Average comments per issue: 1.75
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- nk027 (67)
- hp1819 (5)
- oDNAudio (4)
- msh855 (3)
- thestockman27 (2)
- Abhayprag (2)
- RightHandOfDoom (2)
- BTreitz84 (1)
- tonylwy (1)
- syrop87 (1)
- gusamarante (1)
- AmAzing97 (1)
- arnab13061989 (1)
- aroaballesteros (1)
- lucabarbaglia (1)
Pull Request Authors
- gabrielkonecny (2)
- luboshanus (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 1,168 last-month
- Total docker downloads: 42,005
- Total dependent packages: 1
- Total dependent repositories: 2
- Total versions: 11
- Total maintainers: 1
cran.r-project.org: BVAR
Hierarchical Bayesian Vector Autoregression
- Homepage: https://github.com/nk027/bvar
- Documentation: http://cran.r-project.org/web/packages/BVAR/BVAR.pdf
- License: GPL-3 | file LICENSE
-
Latest release: 1.0.5
published about 2 years ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.3.0 depends
- grDevices * imports
- graphics * imports
- mvtnorm * imports
- stats * imports
- utils * imports
- coda * suggests
- tinytest * suggests
- vars * suggests