Bayesian Vector Autoregressions for forecasting
User manual: see the documentation.
Features
- Natural-conjugate setting (Normal-Inverse-Wishart) with Minnesota shrinkage.
- Sum-of-coefficients and single-unit-root dummy observation priors (implemented with dummy observations).
- Hyperparameter optimisation following GLP (2015) but without the MH step.
- Covid dummies.
- Conditional and unconditional forecasting.
- Soft constraints in conditional forecasting, with uncertainty around the constraints.
- Generalised impulse response functions.
- Conditional forecast counterfactual analysis.
- Hyperparameter optimisation via cross-validation; see this doc.
- Out-of-sample predictive likelihood.
- Features: optimise hyperparameter to maximise the predictive likelihood at a given horizon and for a subset of targeted series.
- Support for skewed constraints (aka upside and downside risks); see this doc.
- Explicitly accounts for nowcasting uncertainty when exploiting nowcasts; see this doc.
- Unit tests and simulation experiments, including:
- Simulation comparing the estimated parameters with the true data generating process.
- Simulation evaluating forecast unbiasedness.
- Simulation checking the moments of the constrained forecast distribution.
Project Structure
├── src/ # Source code
├── docs/ # Documentation and notebooks
├── tests/ # Automated tests
├── ...
Installation
pip install bvar
Selected documentation
Selected notebooks
Contributing
- See CONTRIBUTING.md for details on how to contribute to the code.
- Have a question or an idea? Please open an issue.
Main references
- General model specification, priors and marginal likelihood:
- Implementation (matrix formulation and sampling algorithm):
- Covid dummies
- Conditional forecasting
- Waggoner and Zha (1999) - Hard constraints
- Antolín-Díaz et al. (2021) - Soft constraints
- Generalised IRFs
Data Classification
Bank of England Data Classification: OFFICIAL BLUE
Release files for bvar 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bvar-0.3.5.tar.gz | 124.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bvar-0.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 212.0 kB
Release files / bvar-0.3.5.tar.gz
| Download URL | bvar-0.3.5.tar.gz |
|---|---|
| Size | 124.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7dfb7373483b125720ca8cad6e55d8bad35ddf81a3ed0657048acc3fb51792d
|
|
BLAKE2b-256 checksum How to use checksums |
b9f0931807e5f548bb837ce6e79c8cb33796148180ba47147e5575ce59815a8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency logRelease files / bvar-0.3.5-py3-none-any.whl
| Download URL | bvar-0.3.5-py3-none-any.whl |
|---|---|
| Size | 87.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15cacc75bb743ec8ffe6b51238da411ae205cacebec321fda53adfe8ea096cef
|
|
BLAKE2b-256 checksum How to use checksums |
69051f1e43ae17a383367f11edaf38579a159a89bfc1b01381893eeb10bfa07d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.
Transparency log