groupedpaneldatamodels

A Python package that implements the most commonly used Grouped Panel Data Models

https://github.com/michadenheijer/groupedpaneldatamodels

Science Score: 57.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 8 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary

Keywords

econometrics panel-data
Last synced: 6 months ago · JSON representation ·

Repository

A Python package that implements the most commonly used Grouped Panel Data Models

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 14
  • Releases: 2
Topics
econometrics panel-data
Created about 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License Code of conduct Citation Security Support

README.md

groupedpaneldatamodels: A Python Library for Grouped Fixed and Interactive Effects Models

groupedpaneldatamodels is an open‑source Python library that implements a collection of Grouped Panel Data Models (GPDMs) for econometric research.

groupedpaneldatamodels is an Open Source Python library that implements multiple Grouped Panel Data Models (GPDMs) for Econometric research. These models offer a middle ground between fully homogeneous (which are often incorrectly specified) and fully heterogeneous (which are often difficult to estimate) by grouping multiple individuals and assuming the same coeficients for all members of the groupings.

Features

This package implements the models and algorithms proposed by the following four papers, which each suggest different GPDMS.

  • Grouped Fixed Effects (GFE)
  • Grouped Interactive Fixed Effects (GIFE)
  • Automatic group selection via Information Criteria (BIC, AIC, HQIC).
  • Analytical or bootstrap standard errors
  • Fast NumPy and JIT-compiled Numba core with optional parallel bootstrap for large panels
  • Familiar, statsmodels‑like API

Installation

```bash pip install groupedpaneldatamodels

or update

pip install --upgrade groupedpaneldatamodels ```

To grab the bleeding‑edge version:

bash git clone https://github.com/michadenheijer/groupedpaneldatamodels.git cd groupedpaneldatamodels pip install .


Quick start

```python import numpy as np import groupedpaneldatamodels as gpdm

Y shape (N, T, 1); X shape (N, T, K)

gfe = gpdm.GroupedFixedEffects(Y, X, G=3, model="bonhomme_manresa") gfe.fit() print(gfe.summary())

gife = gpdm.GroupedInteractiveFixedEffects(Y, X, G=3, model="ando_bai", GF=[2, 2, 2]) # 2 common factors per grouping gife.fit() betas = gife.params["beta"] ```

Selecting the number of groups

python best = gpdm.grid_search_by_ic( gpdm.GroupedFixedEffects, param_ranges={"G": range(1, 7)}, init_params={"dependent": Y, "exog": X}, pit_params={"gife_iterations": 100}, ic_criterion="BIC" ) print(best.G) # optimal group count

Documentation

An API reference with proper installation and guidelines is available at https://groupedpaneldatamodels.michadenheijer.com

Simulation Study

A simulation study has been done for the Master's thesis creating this package. This thesis has shown that this package can succesfully reproduce the properties of the underlying estimators and can reduce the RMSE compared to a fully heterogeneous model when N is large and T is small.


Citation

Please cite the thesis if you use groupedpaneldatamodels:

bibtex @mastersthesis{denheijer2025, author = {Micha den Heijer}, title = {groupedpaneldatamodels: A Python Library for Grouped Fixed and Interactive Effects Models}, school = {Vrije Universiteit Amsterdam}, year = {2025}, month = {July}, date = {2025-07-01}, url = {https://groupedpaneldatamodels.michadenheijer.com/_static/thesis.pdf} }


License

Released under the MIT License. See LICENSE for details.

Owner

  • Name: Micha den Heijer
  • Login: michadenheijer
  • Kind: user
  • Location: Amsterdam, The Netherlands
  • Company: Vrije Universiteit Amsterdam

Econometrics and Operations Research student at VU University Amsterdam.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this package, please cite the following work."
authors:
  - family-names: den Heijer
    given-names: Micha
    orcid: https://orcid.org/0009-0009-5151-3897
title: "groupedpaneldatamodels: A Python Library for Grouped Fixed and Interactive Effects Models"
version: "0.1.0"
date-released: 2025-07-01
license: MIT
repository-code: https://github.com/michadenheijer/groupedpaneldatamodels
url: https://groupedpaneldatamodels.michadenheijer.com
type: software

preferred-citation:
  type: thesis
  thesis-type: "Master's thesis"
  title: "groupedpaneldatamodels: A Python Library for Grouped Fixed and Interactive Effects Models"
  authors:
    - family-names: den Heijer
      given-names: Micha
      orcid: https://orcid.org/0009-0009-5151-3897
  year: 2025
  month: 7
  school: Vrije Universiteit Amsterdam
  url: https://groupedpaneldatamodels.michadenheijer.com/_static/thesis.pdf

GitHub Events

Total
  • Release event: 5
  • Push event: 22
  • Create event: 4
Last Year
  • Release event: 5
  • Push event: 22
  • Create event: 4

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 23
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.22
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 23
Past Year
  • Issues: 0
  • Pull requests: 23
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 month
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.22
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 23
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (20)
Top Labels
Issue Labels
Pull Request Labels
dependencies (20) python (16) github_actions (4)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 98 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
pypi.org: groupedpaneldatamodels

A Simple Python library that implements the most commonly used Grouped Panel Data Models

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 98 Last month
Rankings
Dependent packages count: 9.0%
Average: 30.0%
Dependent repos count: 50.9%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/publish.yml actions
.github/workflows/schedule-update-actions.yml actions
  • actions/checkout v3.5.2 composite
  • saadmk11/github-actions-version-updater v0.7.4 composite
.github/workflows/semantic-pr-check.yml actions
  • amannn/action-semantic-pull-request v5.2.0 composite
.github/workflows/sphinx.yml actions
  • sphinx-notes/pages v3 composite