a software for Bayesian time-series econometrics applications
Project description
Alexandria
Alexandria is a Python package for Bayesian time-series econometrics applications. This is the first official release of the software. For its first release, Alexandria includes only the most basic model: the linear regression. However, it proposes a wide range of Bayesian linear regressions:
- 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 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.linear_regression import IndependentBayesianRegression
from alexandria.datasets import data_sets as ds
import numpy as np
# load Taylor dataset, split as train/test
taylor_data = ds.load_taylor()
y_train, X_train = taylor_data[:198,0], taylor_data[:198,1:]
y_test, X_test = taylor_data[198:,0], taylor_data[198:,1:]
# set prior mean and prior variance for the model
b = np.array([1.5, 0.5])
b_const = 1
V = np.array([0.01, 0.0025])
V_const = 0.01
# create and train regression
br = IndependentBayesianRegression(endogenous=y_train, exogenous=X_train,
constant=True, b_exogenous=b, V_exogenous=V, b_constant=b_const, V_constant=V_const)
br.estimate()
# get predictions on test sample, run forecast evaluation, display log score
estimates_forecasts = br.forecast(X_test, 0.95)
br.forecast_evaluation(y_test)
print('log score on test sample : ' + str(round(br.forecast_evaluation_criteria['log_score'], 2)))
===============================
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
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
Built Distribution
File details
Details for the file alexandria-python-0.1.tar.gz
.
File metadata
- Download URL: alexandria-python-0.1.tar.gz
- Upload date:
- Size: 644.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 089aa8e6311a8879d0d2970e746a0365d200efa7456ba838f720c83414385dae |
|
MD5 | ee31d44c013dcc8977218f2e18b67a56 |
|
BLAKE2b-256 | 6d249567e68d0570a5e1895555dad2ebacecce7a411dcdaf187fe3cf5cd059d8 |
File details
Details for the file alexandria_python-0.1-py3-none-any.whl
.
File metadata
- Download URL: alexandria_python-0.1-py3-none-any.whl
- Upload date:
- Size: 666.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0582557f6894a79b79562cae120a0089c9ba1203c4fecd1d261d3d5e614a098 |
|
MD5 | 938b69168f74e7469093f73072c8c589 |
|
BLAKE2b-256 | ea628413b249f4b209462e77a19b1647e1f79316a5d4f54858efcbf82d7dd768 |