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 bioconda 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.1.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.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qglmm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7bc3159050005805e1bf429b7e62b18b71ec18347e0b96a90de24b377af294fa
MD5 e7bb226167d775cd90889725fafa3b8c
BLAKE2b-256 c2255879a1fa6aae2957171f95fd0068a396f65e76470323bbf126e84e2d9fa4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for qglmm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c1eb37265f626a1e6e5b8b8a18d1040248175dc9b045ccf5da7eb3ddc8ebc52
MD5 43e5e3af3bcc107731b2afb43fbba75b
BLAKE2b-256 4d1654e33c4138b9b19cc067ff183637e5aa8864eec3a1ac414bc4f1a761c103

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