R Observatory
Search
install.packages("bsvars")
CRAN 30-day downloads, method
886−8.4% down on the 30 days before, the worse direction
Test coverage, method
60%of lines run by tests

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.

Full description

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, and include exclusion restrictions on autoregressive parameters. 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 (2025) <doi:10.48550/arXiv.2410.15090> complement all this. The implemented techniques align closely with those presented in Lütkepohl, Shang, Uzeda, & Woźniak (2025) <doi:10.1016/j.jeconom.2025.106107>, Lütkepohl & Woźniak (2020) <doi:10.1016/j.jedc.2020.103862>, and Song & Woźniak (2021) <doi:10.1093/acrefore/9780190625979.013.174> and they embed many popular models proposed by other authors. The 'bsvars' package is aligned regarding objects, workflows, and code structure with the R packages 'bsvarSIGNs' by Wang & Woźniak (2025) <doi:10.32614/CRAN.package.bsvarSIGNs>, 'bvars' by Liu, Ramirez Hassan, Woźniak (2026) <doi:10.32614/CRAN.package.bvars>, and 'bpvars' by Woźniak (2026) <doi:10.32614/CRAN.package.bpvars>, and they constitute an integrated toolset.

Maintainer
Tomasz Woźniak
Licence
GPL (>= 3)
Latest release
22 Aug 2026
First release
1 Sep 2022

Compare with another package

More details
Releases
8
Needs compilation
Yes
Needs R
>= 4.1.0
Config/roxygen2/version
8.0.0
Date
2026-08-19
LazyData
true
Task views (2)
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' entry:

citation("bsvars")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.32614/cran.package.bsvars, 10.48550/arxiv.2410.15090, 10.1016/j.jeconom.2025.106107.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for bsvars version 4.0 [Data set]. HJJB, LLC. Data release v2026-10-28. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-28, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    4.0
    Time taken
    473 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    4.0
    Time taken
    363 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    4.0
    Time taken
    345 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    4.0
    Time taken
    369 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    4.0
    Time taken
    642 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    4.0
    Time taken
    56 s
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    4.0
    Time taken
    391 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    4.0
    Time taken
    680 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    4.0
    Time taken
    468 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    4.0
    Time taken
    459 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    4.0
    Time taken
    118 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    4.0
    Time taken
    369 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    4.0
    Time taken
    612 s
  • 13 OK

Over time

No change since 30 Aug 2026

As a list (8)
ChangedWorst statusOKNotesWarningsErrors
30 Aug 2026OK13000
30 Jul 2026Note01300
22 Apr 2026Warning1940
18 Apr 2026Error1841
10 Apr 2026Warning1940
9 Apr 2026Error1931
29 Mar 2026Warning11210
10 Mar 2026Note11300

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
1,549It is the sum of 5 channels: CRAN, r2u, autoCRAN, conda-forge and c2d4u.

CRAN rank

3,889 of 26,530

CRAN

886 downloads in the last 30 days

Rank
3,889 of 26,530
Change
−8.4% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

28 downloads in the last 30 days

Rank
4,072 of 30,526
Change
−56.3% down on the 30 days before, the worse direction

It is in the total. Take it out

autoCRAN

20 downloads in the last 30 days

Rank
2,250 of 29,212
Change
−4.8% down on the 30 days before, the worse direction

It is in the total. Take it out

conda-forge

615 downloads in the last 30 days

Rank
1,339 of 3,828
Change
+1,364% up on the 30 days before, the better direction

It is in the total. Take it out

c2d4u, no longer updated

0 downloads in the last 30 days

Rank
6,270 of 7,575
Change
−100% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
8
Dependent packages
3
Suggested by
1
Needs (8)
Installing it adds
9 packages, 6.2 MB of source
Of those, need compilation
5
Optional extras (2)
Dependent packages (3)
PackageTitleDownloads in 30 days
bsvarSIGNsBayesian SVARs with Sign, Zero, and Narrative Restrictions577
bvarsBayesian Forecasting with Large Vector Autoregressions304
bpvarsForecasting with Bayesian Panel Vector Autoregressions279
Functions
358
Public exports
44
Lines of R code
14,847
Median complexity
1
Functions (358)
Size and composition

Lines by kind (37,263)

KindLinesShare
R code14,84740%
Tests50.0%
Documentation15,36841%
Guides100.0%
Compiled code7,03319%

Lines by language

LanguageLinesShare
Rd15,36841%
R14,85240%
C++6,36817%
C6652%
Vignettes100%

Languages are counted from file extensions.

Files
290
R functions
164
Compiled functions
196
Object systems
S3: 139 methods, R6: 29 classes
Complexity
Median
1
Mean
2.16
Highest
11
Median lines per function
19
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
164
Calls
19
Unconnected
143
Groups
2
Growth (8 releases)
Total lines by release
8,578 on 1 Sep 202237,263 on 22 Aug 2026
Release changes

The tests ran and coverage was measured.

Lines run by tests
59.8%
Expressions run by tests
65%
Test cases
206
Exports named in tests
0%
Coverage by file (27)
Coverage run
Lines counted
3,410
Lines the tests ran
1,596
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
tinytest
Test cases
206
Lines of tests
5
Test lines per line of code
0
Exports documented
100%
Arguments documented
100%
Return value documented
31.8%
Help pages with examples
99.4%
Examples run in checks
100%
Guides (1)
Other documentation
README
Yes, 1,194 words
Release notes file
Yes
Help pages
178
Lines of documentation
15,368
DatasetSize
us_fiscal_cond_forecastsA 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 endogen8 × 3
us_fiscal_exA 3-variable system of exogenous variables for the US fiscal model for the period 1948 Q1 -- 2026 Q1313 × 3
us_fiscal_ex_forecastsA 3-variable system of exogenous variables' future values for the forecast horizon of two years for the US fiscal model for the period 2026 Q2 -- 2028 Q18 × 3
us_fiscal_lsuwA 3-variable US fiscal system for the period 1948 Q1 -- 2026 Q1313 × 3
us_fiscal_swwA 10-variable US fiscal system for the period 1948 Q1 -- 2025 Q3266 × 10

bsvars / bsvars on github.com

Stars
63no change on 30 days ago
Forks
17
Open issues
9
Last commit
29 Sep 2026
Activity
Commits
812
Open pull requests
0
Tagged releases
8
Latest tagged release
v4.0, 24 Aug 2026
In development
Default branch at 4.0.0.9000, ahead of CRAN 4.0 (checked 2026-10-25)
Issues closed in
31 days (median)
Pull requests closed in
0 days (median)
Pull requests merged
88%
Created
29 Aug 2022
Licence file reads as
–
Development practices (8)
KindFound
Continuous integrationGitHub Actions, R CMD check workflow
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Docs sourceREADME.Rmd, pkgdown
GitHub Pages site last deployed 2026-09-29
The repository has a site deploy workflow
pkgdown site last built 2026-08-24
CRAN release processcran-comments.md
Lint, format, editorRStudio project

Method, repository practices

Across bsvars

R releases
  • On CRAN
  • Release
VersionReleasedR
4.0 current22 Aug 20264.6.1
3.224 Oct 20244.4.1
3.114 Jul 20244.4.1
3.0.128 Jun 20244.4.1
3.019 Jun 20244.4.1
2.1.011 Dec 20234.3.2
2.0.024 Oct 20234.3.1
1.0.01 Sep 20224.2.1
Release notes (4.0)

The package is under intensive development, and more functionality will be provided soon! To see the package ROADMAP towards the next version.

Have a question, or suggestion, or wanna get in touch? Email us at [contact\@bsvars.org](mailto:contact@bsvars.org) forum.

The model with Student-t structural shocks features now, an estimated equation-specific degrees-of-freedom parameter, see specify_bsvar_t() with verified normality using function verify_identification() #84

Updated C++ flags to the newest recommended setup as inspired by the PR #103 by \@haansn08

Corrected C++ code for historical decompositions in PR #108 by Adam Wang

Upon popular request the package includes possibility of imposing exclusion restrictions on autoregressive parameters for all models #106

Improved forecasting plots to accommodate those for horizon = 1 #121

A NEW MODEL! A BSVAR with heterogeneous Markov switching heteroskedasticity #58

ALL MODELS can have normal or Student-t distributed shocks. There's a new arguent in all specify_* functions distribution = c("norm", "t"). #58

A NEW MODEL! A BSVAR with exogenous heteroskedastic regime changes. #23

Updates CXX flags. #125

Simplified examples in documentation to better express the simplicity of workflows as suggested by \@robjhyndman. #120

Replaced forecast method with generics::forecast as suggested by \@robjhyndman. #114

Normalisation is now made through the generic and methods normalise 131

Corrected R code for forecasting with HMSH models in PR #136 by Bruno Cavalcante

Corrected C++ code for Student's t shocks in PR #140 by Fei Shang

Fix recursive forecasts for non-centred SV and Student-t specifications in PR #140 by Fei Shang

Major code corrections by Fei Shang in PRs #143 #144 #145 #146 #148 #149 #150 #151 #153 #155

Forecast output formatted using R6 environment #138

Fixed historical decomposition crash in PR #156 by Adam Wang

Corrected plots with provided shock names. Thanks to \@nreigl who reported issue #104.

Implemented many interesting suggestions submitted by \@robjhyndman in issues #115 #117 #118 and #119.