Politics & Elections
Voting patterns, electoral forecasting, and spatial models for political behavior.
Fast, accurate posteriors for Latent Gaussian Models in seconds, not hours.
pip install pyinlafrom pyinla import pyinla
# Your data
y = [2.1, 1.8, 3.0, 2.5, 1.9] # what you observe
x = [0.2, 0.5, 0.7, 1.1, 1.3] # predictor variable
# Define the model
model = {
"response": "y", # column to predict
"fixed": ["x"] # covariates
}
# Fit and get results
result = pyinla(model=model, family="gaussian", data=df)
print(result.summary_fixed)
The INLA methodology powers research in disease mapping, environmental modeling, spatial econometrics, and time-series analysis across the globe. The original implementation, R-INLA, has been the standard for over a decade.
pyinla brings this proven methodology to Python, sharing the same C/C++ computational core. It offers an independent API with features and models actively expanded based on community needs.
INLA is used across fields where uncertainty quantification and spatial-temporal modeling are essential.
Voting patterns, electoral forecasting, and spatial models for political behavior.
Demand forecasting, credit risk, and regional economic performance.
Disease mapping, mortality trends, and outbreak detection.
Gaussian processes, state-space models, and structured random effects with uncertainty.
Mobility patterns, traffic flow, and demand modeling.
Player performance, win probability, and expected goals (xG).
Species distributions, air quality, and climate impact assessment.
Point patterns, areal data, and continuous spatial fields.
Native Python access to INLA with intuitive syntax, pandas integration, and built-in diagnostics.
Full posterior inference in seconds through the INLA computational engine.
Specify models with fixed effects, random effects, and spatial components using familiar syntax.
Posterior summaries, PIT histograms, and residual diagnostics included.
Works directly with DataFrames and integrates with matplotlib, seaborn, and other Python tools.
Add custom likelihoods and latent effects through documented extension points.
Step-by-step tutorials, API reference, and reproducible notebooks.
Decision infrastructure for domains where uncertainty matters.
Suitable for research and early applied deployments where calibrated uncertainty and fast iteration are required.
Stay up to date with the latest developments in pyINLA.
pyINLA is currently in an internal testing phase while we validate the Python interface. Expect rapid changes as we harden the API, broaden likelihood coverage, and publish full documentation.
Over the next releases we will continue porting worked examples, exercising every feature against the reference workflows, and publishing migration notes. Follow this space for announcements as additional likelihoods, latent models, and notebooks graduate from testing to general availability.
Want to receive updates as new features are released, or interested in contributing to a specific likelihood or latent model? Contact us at contact@pyinla.org and let us know what you'd like to work on or follow.
pyINLA provides sensible defaults while allowing explicit configuration when needed. The same workflow applies to spatial, temporal, and survival models.
The Integrated Nested Laplace Approximation (INLA) is a strategy for fast, approximate Bayesian inference in Latent Gaussian Models, enabling rich models with practical runtime.
How INLA works ↗Install pyINLA and follow the quickstart to fit your first model.
pip install pyinlaFound a bug? Have a feature request? Want to share feedback or ask a question? Get in touch and let us know.