Metadata-Version: 2.4
Name: qglmm
Version: 0.1.0
Summary: Quick Generalized Linear Mixed Models
Author-email: Ali Akbari <alek0991@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Ali Akbari
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: statsmodels
Requires-Dist: scipy
Dynamic: license-file

# 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:
```bash
conda install -c conda-forge fastglmm
```

## 🚀 Usage
```python
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)
```

