matrixlm: a julia package to obtain closed-form least squares estimates for matrix linear models

MatrixLM is an open-source Julia package for fitting matrix linear models, which extend classical linear regression to a bilinear framework for matrix-valued responses. It is designed for analyzing high-throughput assays in which both rows and columns of the data matrix have associated covariates, such as in metabolomics, proteomics, or chemical genetic screens.

In a matrix linear model, the entries of a response matrix are modeled as a joint function of sample-level covariates (e.g., treatment group, demographic factors) and feature-level covariates (e.g., molecular or anatomical annotations, biological groups, pathways). MatrixLM implements efficient estimation and inference for this class of models using fast matrix operations whenever possible allowing users to fit large numbers of models while retaining an explicit linear model interpretation. The inputs include a response matrix and two design matrices encoding the row and column covariates, and the main outputs include estimated coefficients, standard errors, and test statistics for user-specified contrasts.

Compared with workflows built from many separate univariate models, MatrixLM provides a unified interface for specifying, fitting, and summarizing matrix linear models. This reduces code duplication, improves reproducibility, and makes it easier to express hypotheses that naturally involve both sample- and feature-level information (for example, testing for differential effects across feature groups or experimental conditions). By providing an efficient implementation in Julia, MatrixLM enables researchers to perform interpretable analyses of large structured matrix-valued data.