Skip to main content

Quick Generalized Linear Mixed Models

Project description

qglmm

qglmm is a fast implementation of a Generalized Linear Mixed Model (GLMM) for count/binomial data with variance components.
It is inspired by PQLseq (Sun et al. 2019; PMID: 30020412), with added flexibility and significant performance improvements.

✨ Features

  • Supports Binomial family with logit link
  • Order-of-magnitude faster than PQLseq
  • Handles variance components (tau1, tau2) with options:
    • Fixed values
    • Inference from data
  • Stable Newton-Raphson updates with adaptive step size
  • Regularization for numerical stability
  • Easy to use API similar to statsmodels

📦 Installation

You can easily install fastGLMM via Conda:

conda install -c conda-forge fastglmm

🚀 Usage

import numpy as np
from fastglmm import GLMM

# Simulated data
n = 100
np.random.seed(0)
X = np.hstack((np.ones((n, 1)), np.random.randn(n, 2)))
Y = np.hstack((np.random.randint(0, 10, (n, 1)), np.random.randint(1, 10, (n, 1))))
G = np.random.randn(n, 500)
K = G @ G.T

# Fit model
res = GLMM(X, Y, K).fit()

# Summary
param, coef = res.summary()
print(param)
print(coef)

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

qglmm-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

qglmm-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file qglmm-0.1.0.tar.gz.

File metadata

  • Download URL: qglmm-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for qglmm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 587ae19d87bcb92d7044fdedd17013b4825bc8116273b04750dde7d4ae82ec48
MD5 e8911b5cf5da42081bab04df0d4d187e
BLAKE2b-256 fcdcae7a2699fb2b5ee3f2513c1b89eb6d784aa97e1493e2df5aba1304a25599

See more details on using hashes here.

File details

Details for the file qglmm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qglmm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for qglmm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2ccbe852f878c6c34d37cd0fdf6c866d3f389c649aa13a503750d69206bcd36
MD5 b49a8c2a9c9226eaa0e3ec7facf5b83c
BLAKE2b-256 be18ed4a30296c45ba867c9404327f32536da9317f7ada4bdebbb03fd637a771

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