{"id":32209368,"url":"https://github.com/nk027/bvar","last_synced_at":"2026-02-20T16:02:09.370Z","repository":{"id":37951208,"uuid":"160569216","full_name":"nk027/bvar","owner":"nk027","description":"Toolkit for the estimation of hierarchical Bayesian vector autoregressions. Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza \u0026 Primiceri (2015). Allows for the computation of impulse responses and forecasts and provides functionality for assessing results.","archived":false,"fork":false,"pushed_at":"2024-11-12T20:01:03.000Z","size":5997,"stargazers_count":56,"open_issues_count":22,"forks_count":23,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-09T11:57:32.557Z","etag":null,"topics":["bayesian","bvar","forecasts","impulse-responses","vector-autoregressions"],"latest_commit_sha":null,"homepage":"https://cran.r-project.org/package=BVAR","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nk027.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-05T19:39:52.000Z","updated_at":"2025-10-21T15:44:17.000Z","dependencies_parsed_at":"2025-09-08T13:31:46.254Z","dependency_job_id":"d22aa119-04d1-4563-b417-7f43ce27c0ae","html_url":"https://github.com/nk027/bvar","commit_stats":{"total_commits":519,"total_committers":7,"mean_commits":74.14285714285714,"dds":0.5934489402697496,"last_synced_commit":"14cfbb8b5a2d88f48ea918847359d344834950eb"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/nk027/bvar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk027%2Fbvar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk027%2Fbvar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk027%2Fbvar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk027%2Fbvar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nk027","download_url":"https://codeload.github.com/nk027/bvar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nk027%2Fbvar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","bvar","forecasts","impulse-responses","vector-autoregressions"],"created_at":"2025-10-22T06:03:21.549Z","updated_at":"2026-02-20T16:02:09.366Z","avatar_url":"https://github.com/nk027.png","language":"R","readme":"\nBVAR: Hierarchical Bayesian Vector Autoregression\n=======\n\n[![CRAN](https://www.r-pkg.org/badges/version/BVAR)](https://cran.r-project.org/package=BVAR)\n[![codecov](https://codecov.io/gh/nk027/bvar/branch/master/graph/badge.svg)](https://app.codecov.io/gh/nk027/bvar)\n[![month](https://cranlogs.r-pkg.org/badges/BVAR)](https://www.r-pkg.org/pkg/BVAR)\n[![total](https://cranlogs.r-pkg.org/badges/grand-total/BVAR)](https://www.r-pkg.org/pkg/BVAR)\n\nEstimation of hierarchical Bayesian vector autoregressive models following Kuschnig \u0026 Vashold (2021). Implements hierarchical prior selection for conjugate priors in the fashion of Giannone, Lenza \u0026 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.\n\nInstallation\n-------\n\n**BVAR** is available on [CRAN](https://CRAN.R-project.org/package=BVAR). The development version can be installed from GitHub.\n``` r\ninstall.packages(\"BVAR\")\ndevtools::install_github(\"nk027/BVAR\")\n```\n\nUsage\n-------\n\nThe 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.\n\nAnalysis 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](https://cran.r-project.org/package=BVARverse)** package.\n\n**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.\n\nDemonstration\n-------\n\n``` r\n# Load the package\nlibrary(\"BVAR\")\n\n# Access a subset of the fred_qd dataset\ndata \u003c- fred_qd[, c(\"GDPC1\", \"CPIAUCSL\", \"UNRATE\", \"FEDFUNDS\")]\n# Transform it to be stationary\ndata \u003c- fred_transform(data, codes = c(5, 5, 5, 1), lag = 4)\n\n# Estimate using default priors and MH step\nx \u003c- bvar(data, lags = 1)\n\n# Check convergence via trace and density plots\nplot(x)\n\n# Calculate and store forecasts and impulse responses\npredict(x) \u003c- predict(x, horizon = 20)\nirf(x) \u003c- irf(x, horizon = 20, identification = TRUE)\n\n# Plot forecasts and impulse responses\nplot(predict(x))\nplot(irf(x))\n```\n\nReferences\n-------\n\nNikolas 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](https://doi.org/10.18637/jss.v100.i14).\n\nDomenico 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/REST_a_00483](https://doi.org/10.1162/REST_a_00483).\n\nMichael W. McCracken and Serena Ng (2016). FRED-MD: A Monthly Database for Macroeconomic Research. *Journal of Business \u0026 Economic Statistics*, 34:4, 574-589, DOI: [10.1080/07350015.2015.1086655](https://doi.org/10.1080/07350015.2015.1086655).\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnk027%2Fbvar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnk027%2Fbvar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnk027%2Fbvar/lists"}