Alexandria
Alexandria is a Python package for Bayesian time-series econometrics applications. This is the second official release of the software, which introduces Bayesian vector autorgressions.
This is version 3.0, which includes Bayesian regression, Bayesian vector autoregression, Bayesian VEC/VARMA models, and Bayesian nowcasting.
Alexandria offers a range of Bayesian linear regression models:
- maximum likelihood / OLS regression (non-Bayesian)
- simple Bayesian regression
- hierarchical (natural conjugate) Bayesian regression
- independent Bayesian regression with Gibbs sampling
- heteroscedastic Bayesian regression
- autocorrelated Bayesian regression
Alexandria also offers a large number of Bayesian vector autoregression models and applications:
- maximum likelihood (OLS) VAR
- Litterman Minnesota prior
- normal-Wishart prior
- independent prior with Gibbs sampling
- dummy observation prior
- large Bayeisian VAR prior
- Bayesian oxy-SVAR
prior customization:
- constrained coefficients
- dummy extensions (sums-of-coefficients, initial observation,long-run prior)
- stationary priors
- hyperparameter optimization from marginal likelihood
structural identification:
- Cholesky
- triangular factorization
- restrictions: sign and zero restrictions on IRFs, narrative on shocks and historical decomposition
applications:
- forecasts
- impulse response function
- forecast error variance decomposition
- historical decomposition
- conditional forecasts (agnostic and sctructural approaches, allowing for hard and soft conditions)
Alexandria also includes Bayesian VEC and VARMA models, along with many applications:
- Bayesian VEC: uninformative, horseshoe and selection priors; general and reduced-rank approaches
- Bayesian VARMA: Minnesota prior on autoegressive and lag coefficients; residuals estimated from Bayesian state-space modelling
- structural identification and applications are the same as the Bayesian VAR models
The current version introduces Bayesian nowcasting models, along with many applications:
- Mixed Frequency Bayesian VAR: allows for mixed frequency, missing observations, and frequency decomposition; all BVAR applications are available with the MF-BVAR.
- Bayesian Dynamic Factor Model: extract structural factors from high and low frequency features; nowcasts in real time; also permits structural IRFs, variance and historical decomposition.
- Bayesian MIDA regression: 3 priors (Minnesota, Horseshoe, Bayesian lasso) and 3 representations (unrestricted MIDAS, Almon, Fourier).
Alexandria is user-friendly and can be used from a simple Graphical User Inteface (GUI). More experienced users can also run the models directly from the Python console by using the model classes and methods.
===============================
Installing Alexandria
Alexandria can be installed from pip:
pip install alexandria-python
A local installation can also obtain by copy-pasting the folder containing the toolbox programmes. The folder can be downloaded from the project website or Github repo:
https://alexandria-toolbox.github.io
https://github.com/alexandria-toolbox
===============================
Getting started
Simple Python example:
# imports
from alexandria import NormalWishartBayesianVar
from alexandria import DataSets
from alexandria import Graphics
import numpy as np
# load ISLM dataset
ds = DataSets()
islm_data = ds.load_islm()[:,:4]
# create and train Bayesian VAR with default settings
var = NormalWishartBayesianVar(endogenous = islm_data)
var.estimate()
# estimate forecasts for the next 4 periods, 60% credibility level
forecast_estimates = var.forecast(4, 0.6)
# create graphics of predictions
gp = Graphics(var)
gp.forecast_graphics(show=True, save=False)
===============================
Documentation
Complete manuals and user guides can be found on the project website and Github repo:
https://alexandria-toolbox.github.io
https://github.com/alexandria-toolbox
===============================
Contact
Metadata
Release files for alexandria-python 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alexandria_python-3.0.0.tar.gz | 879.1 kB | Without provenance | Details for alexandria_python-3.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alexandria_python-3.0.0-py3-none-any.whl | Python 3 | none | any | Details for alexandria_python-3.0.0-py3-none-any.whl |
Total release size: 1.8 MB
Release files / alexandria_python-3.0.0.tar.gz
| Download URL | alexandria_python-3.0.0.tar.gz |
|---|---|
| Size | 879.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a71f96d72f3a699a7b16221c5213378c3d46bf96749e16dce327bbe6e5c2c7e
|
|
BLAKE2b-256 checksum How to use checksums |
2fe4aec66b3d501787a699249c09b633733949e7b8ef63448a75830c26084b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / alexandria_python-3.0.0-py3-none-any.whl
| Download URL | alexandria_python-3.0.0-py3-none-any.whl |
|---|---|
| Size | 928.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8559d92b016d067c03a15b815dfb305548822c25fa5f680997aa73b047d4cc43
|
|
BLAKE2b-256 checksum How to use checksums |
6ea63a5ac9869e07170c23426bc6bb402136f6702eeb97d52d3639359de32f64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for alexandria-python 3.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.