blmm: Fast approximate mixed-effects engine for ALDEx3.

blmmR Documentation

Fast approximate mixed-effects engine for ALDEx3.

Description

Fast approximate mixed-effects engine for ALDEx3.

Usage

blmm(logW, formula, data, n.cores = 1L)

Arguments

logW

numeric array (N x D x S)

formula

lme4 mixed-effects formula

data

data.frame for formula evaluation

n.cores

number of worker processes for feature-level parallelism. If n.cores > 1, features are distributed across workers; the per-feature draw loop remains serial.

Details

Internal engine called by aldex when method = "blmm".

Uses an lme4-style profiled Gaussian LMM formulation. One batched anchor REML problem is fit per feature across all S MC draws; draw-specific local covariance updates are obtained via a single Newton step; exact conditional GLS fixed-effect solves are then run per draw. The approximation is only in the variance-component step — fixed effects and standard errors are exact conditional on the updated covariance parameters.

Draw-specific updates that fail a profiled-objective check are re-fit with exact lme4. Failure of the shared anchor optimisation, or an unusable anchor Hessian, causes exact fallback for every draw in the feature. A single consolidated warning reports either kind of rescue.

Value

named list of arrays (P x D x S): estimate, std.error, df, p.lower, p.upper, and (Pr x D x S) random.eff — same layout as sr.mem.


ALDEx3 documentation built on Oct. 20, 2026, 1:07 a.m.