Skip to main content

a software for Bayesian vector autoregressions and other Bayesian time-series applications

Project description

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

alexandria.toolbox@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alexandria_python-3.0.0.tar.gz (879.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alexandria_python-3.0.0-py3-none-any.whl (928.2 kB view details)

Uploaded Python 3

File details

Details for the file alexandria_python-3.0.0.tar.gz.

File metadata

  • Download URL: alexandria_python-3.0.0.tar.gz
  • Upload date:
  • Size: 879.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for alexandria_python-3.0.0.tar.gz
Algorithm Hash digest
SHA256 8a71f96d72f3a699a7b16221c5213378c3d46bf96749e16dce327bbe6e5c2c7e
MD5 6d44aefe887eaca90ccc19d863a00ae7
BLAKE2b-256 2fe4aec66b3d501787a699249c09b633733949e7b8ef63448a75830c26084b6e

See more details on using hashes here.

File details

Details for the file alexandria_python-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for alexandria_python-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8559d92b016d067c03a15b815dfb305548822c25fa5f680997aa73b047d4cc43
MD5 d850e3008b9dc7bc86793fa7957c2a4d
BLAKE2b-256 6ea63a5ac9869e07170c23426bc6bb402136f6702eeb97d52d3639359de32f64

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page