Skip to main content

GNU GENERAL PUBLIC LICENSE

Project description

Bayesian Inference (BI)

BI software is available in both Python and R. It aims to unify the modeling experience by integrating an intuitive model-building syntax with the flexibility of low-level abstraction coding available but also pre-build function for high-level of abstraction and including hardware-accelerated computation for improved scalability.

Currently, the package provides:

  • Data manipulation:

    • One-hot encoding
    • Conversion of index variables
    • Scaling
  • Models (Using Numpyro):

    • Linear Regression for continuous variable
    • Multiple continuous Variable
    • Interaction between variables
    • Categorical variable
    • Binomial model
    • Beta binomial
    • Poisson model
    • Gamma-Poisson
    • Multinomial
    • Dirichlet model
    • Zero inflated
    • Varying intercept
    • Varying slopes
    • Gaussian processes
    • Measuring error
    • Latent variable]
    • PCA
    • GMM
    • DPMM
    • Network model
    • Network with block model
    • Network control for data collection biases
    • BNN
  • Model diagnostics (using ARVIZ):

    • Data frame with summary statistics
    • Plot posterior densities
    • Bar plot of the autocorrelation function (ACF) for a sequence of data
    • Plot rank order statistics of chains
    • Forest plot to compare HDI intervals from a number of distributions
    • Compute the widely applicable information criterion
    • Compare models based on their expected log pointwise predictive density (ELPD)
    • Compute estimate of rank normalized split-R-hat for a set of traces
    • Calculate estimate of the effective sample size (ESS)
    • Pair plot
    • Density plot
    • ESS evolution plot

Why?

1. To learn

2. Easy Model Building:

The following linear regression model (rethinking 4.Geocentric Models):

height∼Normal(μ,σ)

μ=α+β*weight

α∼Normal(178,20)

β∼Normal(0,10)

σ∼Uniform(0,50)

can be declared in the package as

from BI import bi

# Setup device------------------------------------------------
m = bi(platform='cpu')

# Import Data & Data Manipulation ------------------------------------------------
# Import
from importlib.resources import files
data_path = files('BI.resources.data') / 'Howell1.csv'
m.data(data_path, sep=';') 
m.df = m.df[m.df.age > 18] # Manipulate
m.scale(['weight']) # Scale

# Define model ------------------------------------------------
def model(weight, height):    
    a = m.dist.normal(178, 20, name = 'a') 
    b = m.dist.lognormal(0, 1, name = 'b') 
    s = m.dist.uniform(0, 50, name = 's') 
    m.normal(a + b * weight , s, obs = height) 

# Run mcmc ------------------------------------------------
m.run(model)  # Optimize model parameters through MCMC sampling

# Summary ------------------------------------------------
m.summary() # Get posterior distributions

Todo

  1. GUI
  2. Documentation
  3. Implementation of additional MCMC sampling methods

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

bayesinference-0.0.7.tar.gz (55.3 MB view details)

Uploaded Source

Built Distribution

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

bayesinference-0.0.7-py3-none-any.whl (55.5 MB view details)

Uploaded Python 3

File details

Details for the file bayesinference-0.0.7.tar.gz.

File metadata

  • Download URL: bayesinference-0.0.7.tar.gz
  • Upload date:
  • Size: 55.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for bayesinference-0.0.7.tar.gz
Algorithm Hash digest
SHA256 4e3be7121ca9f4b1b1650b90c856af70a07ea07eee85dd50c018d2a88f415509
MD5 5bbe56a2357d9c8957b95d41c3b5c5e7
BLAKE2b-256 e089015e67e8642cdeb4483b6c079c1c8d198c1478da3f1d30dee3c882fca4f2

See more details on using hashes here.

File details

Details for the file bayesinference-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: bayesinference-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 55.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for bayesinference-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 097deccf03d7a0622033a4f41bfb01bd7a455ff1c6f9e8f0f87bcac74d5892f6
MD5 ede82f4a83ac18684653c6149b2cfb65
BLAKE2b-256 56882feed64dba02394990745190946c801c3dfe73a5876ce1042696e40bbc9a

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