All Projects → bashtage → Linearmodels

bashtage / Linearmodels

Licence: other
Add linear models including instrumental variable and panel data models that are missing from statsmodels.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Linearmodels

Minimalistic-Multiple-Layer-Neural-Network-from-Scratch-in-Python
Minimalistic Multiple Layer Neural Network from Scratch in Python.
Stars: ✭ 24 (-94.09%)
Mutual labels:  regression
Pycaret
An open-source, low-code machine learning library in Python
Stars: ✭ 4,594 (+1031.53%)
Mutual labels:  regression
Statistical rethinking with brms ggplot2 and the tidyverse
The bookdown version lives here: https://bookdown.org/content/3890
Stars: ✭ 350 (-13.79%)
Mutual labels:  regression
netflix-style-recommender
A simple movie recommendation engine
Stars: ✭ 65 (-83.99%)
Mutual labels:  regression
Fuku Ml
Simple machine learning library / 簡單易用的機器學習套件
Stars: ✭ 280 (-31.03%)
Mutual labels:  regression
Go Deep
Artificial Neural Network
Stars: ✭ 303 (-25.37%)
Mutual labels:  regression
Synthetic-data-gen
Various methods for generating synthetic data for data science and ML
Stars: ✭ 57 (-85.96%)
Mutual labels:  regression
Toolbarpanel
Toolbar that can be slided down to show a panel
Stars: ✭ 397 (-2.22%)
Mutual labels:  panel
R
All Algorithms implemented in R
Stars: ✭ 294 (-27.59%)
Mutual labels:  regression
Srmd
Learning a Single Convolutional Super-Resolution Network for Multiple Degradations (CVPR, 2018) (Matlab)
Stars: ✭ 333 (-17.98%)
Mutual labels:  regression
panel
Panel for your CS:GO cheat.
Stars: ✭ 25 (-93.84%)
Mutual labels:  panel
jsPanel3
A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
Stars: ✭ 89 (-78.08%)
Mutual labels:  panel
Mqtt Panel
A web interface for MQTT
Stars: ✭ 315 (-22.41%)
Mutual labels:  panel
action
📦📊 GitHub Action to reports on the size of your npm package
Stars: ✭ 36 (-91.13%)
Mutual labels:  regression
Glm.jl
Generalized linear models in Julia
Stars: ✭ 358 (-11.82%)
Mutual labels:  regression
Kickstarter-Anticipator
The main aim of this project is to tell that the certain project will be successful or it will fail by applying machine learning algorithm. In this , LOGISTIC REGRESSION is used to determine the success of the project by splitting the data into training and testing models and predicting a successful one.
Stars: ✭ 13 (-96.8%)
Mutual labels:  regression
Regression
Multivariable regression library in Go
Stars: ✭ 300 (-26.11%)
Mutual labels:  regression
Machine Learning
⚡机器学习实战(Python3):kNN、决策树、贝叶斯、逻辑回归、SVM、线性回归、树回归
Stars: ✭ 5,601 (+1279.56%)
Mutual labels:  regression
Mlpack
mlpack: a scalable C++ machine learning library --
Stars: ✭ 3,859 (+850.49%)
Mutual labels:  regression
Tensorflow Resources
Curated Tensorflow code resources to help you get started with Deep Learning.
Stars: ✭ 330 (-18.72%)
Mutual labels:  regression

Linear Models

Metric
Latest Release PyPI version
Continuous Integration Build Status
Build status
Coverage codecov
Code Quality Codacy Badge
codebeat badge
Code Quality: Python
Total Alerts
Citation DOI

Linear (regression) models for Python. Extends statsmodels with Panel regression, instrumental variable estimators, system estimators and models for estimating asset prices:

  • Panel models:

    • Fixed effects (maximum two-way)
    • First difference regression
    • Between estimator for panel data
    • Pooled regression for panel data
    • Fama-MacBeth estimation of panel models
  • High-dimensional Regresssion:

    • Absorbing Least Squares
  • Instrumental Variable estimators

    • Two-stage Least Squares
    • Limited Information Maximum Likelihood
    • k-class Estimators
    • Generalized Method of Moments, also with continuously updating
  • Factor Asset Pricing Models:

    • 2- and 3-step estimation
    • Time-series estimation
    • GMM estimation
  • System Regression:

    • Seemingly Unrelated Regression (SUR/SURE)
    • Three-Stage Least Squares (3SLS)
    • Generalized Method of Moments (GMM) System Estimation

Designed to work equally well with NumPy, Pandas or xarray data.

Panel models

Like statsmodels to include, supports patsy formulas for specifying models. For example, the classic Grunfeld regression can be specified

import numpy as np
from statsmodels.datasets import grunfeld
data = grunfeld.load_pandas().data
data.year = data.year.astype(np.int64)
# MultiIndex, entity - time
data = data.set_index(['firm','year'])
from linearmodels import PanelOLS
mod = PanelOLS(data.invest, data[['value','capital']], entity_effects=True)
res = mod.fit(cov_type='clustered', cluster_entity=True)

Models can also be specified using the formula interface.

from linearmodels import PanelOLS
mod = PanelOLS.from_formula('invest ~ value + capital + EntityEffects', data)
res = mod.fit(cov_type='clustered', cluster_entity=True)

The formula interface for PanelOLS supports the special values EntityEffects and TimeEffects which add entity (fixed) and time effects, respectively.

Instrumental Variable Models

IV regression models can be similarly specified.

import numpy as np
from linearmodels.iv import IV2SLS
from linearmodels.datasets import mroz
data = mroz.load()
mod = IV2SLS.from_formula('np.log(wage) ~ 1 + exper + exper ** 2 + [educ ~ motheduc + fatheduc]', data)

The expressions in the [ ] indicate endogenous regressors (before ~) and the instruments.

Installing

The latest release can be installed using pip

pip install linearmodels

The main branch can be installed by cloning the repo and running setup

git clone https://github.com/bashtage/linearmodels
cd linearmodels
python setup.py install

Documentation

Stable Documentation is built on every tagged version using doctr. Development Documentation is automatically built on every successful build of main.

Plan and status

Should eventually add some useful linear model estimators such as panel regression. Currently only the single variable IV estimators are polished.

  • Linear Instrumental variable estimation - complete
  • Linear Panel model estimation - complete
  • Fama-MacBeth regression - complete
  • Linear Factor Asset Pricing - complete
  • System regression - complete
  • Linear IV Panel model estimation - not started
  • Dynamic Panel model estimation - not started

Requirements

Running

With the exception of Python 3 (3.7+ tested), which is a hard requirement, the others are the version that are being used in the test environment. It is possible that older versions work.

  • Python 3.7+
  • NumPy (1.15+)
  • SciPy (1.3+)
  • pandas (0.25+)
  • statsmodels (0.11+)
  • xarray (0.13+, optional)
  • Cython (0.29.21+, optional)

Testing

  • py.test

Documentation

  • sphinx
  • sphinx-material
  • nbsphinx
  • nbconvert
  • nbformat
  • ipython
  • jupyter
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].