Skip to main content

PyTorch-based AI-REML estimation for linear mixed models

Project description

torch-openreml

torch-openreml is an experimental Python library for fitting linear mixed-effects models using Average Information REML (AI-REML) with Torch.

Overview

This package focuses purely on the computational backend of mixed model estimation. It implements the AI-REML algorithm using Torch for tensor operations and automatic differentiation of covariance structures, while parameter updates are carried out explicitly using the Average Information matrix.

Unlike traditional mixed-model software, torch-openreml does not provide a formula interface or a model parser. It is designed for users who want full control over model specification and are comfortable constructing model matrices and covariance structures programmatically.

Note

The library may be highly inefficient due to its experimental nature and ongoing development.

Philosophy

This library separates computation from interface:

  • It does not implement formula syntax (e.g., y ~ x + (1|g)).
  • It does not handle data preprocessing, design matrix construction, or model specification parsing.

Model Formulation

The library assumes the standard linear mixed-effects model:

$$y = X\beta + Zb + \varepsilon$$

where:

  • $y \in \mathbb{R}^n$: response vector
  • $X \in \mathbb{R}^{n \times p}$: fixed-effects design matrix
  • $\beta \in \mathbb{R}^p$: fixed-effects coefficients
  • $Z \in \mathbb{R}^{n \times q}$: random-effects design matrix
  • $b \in \mathbb{R}^q$: random effects
  • $\varepsilon \in \mathbb{R}^n$: residual errors

Distributional Assumptions

$$b \sim \mathcal{N}(0, G(\theta)), \quad \varepsilon \sim \mathcal{N}(0, R(\theta))$$

where both covariance structures are parameterized by $\theta$.

The marginal covariance of $y$ is:

$$V = Z G(\theta) Z^\top + R(\theta).$$

Status

⚠️ Experimental

This library is under active development and should be considered experimental. Interfaces and implementations may change without backward compatibility guarantees.

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

torch_openreml-0.1.0a0.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

torch_openreml-0.1.0a0-py3-none-any.whl (60.9 kB view details)

Uploaded Python 3

File details

Details for the file torch_openreml-0.1.0a0.tar.gz.

File metadata

  • Download URL: torch_openreml-0.1.0a0.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for torch_openreml-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 d23750398bc9e7912481666691a3a72124ffa6ea834eda3cfb9701c0fd5405c8
MD5 20dd6a126cdb62c781301870f7327424
BLAKE2b-256 037ce3b098758f23e64dfea1251547d2e87da5a35a7e6338a5106e5e3210fee7

See more details on using hashes here.

File details

Details for the file torch_openreml-0.1.0a0-py3-none-any.whl.

File metadata

File hashes

Hashes for torch_openreml-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cd324145f4aaea054220e6098f4a2fad34c09ccb024bc6f14967b446d9ab9da
MD5 6aeaf0ebd167274633786f37151647fe
BLAKE2b-256 5e94999351456f5381f442b560f7d751369534a10b5b285915a3702cbc0350ee

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