Learn R Programming

sommer: Solving Mixed Model Equations in R

Structural multivariate-univariate linear mixed model solver for estimation of multiple random effects with unknown variance-covariance structures (e.g., heterogeneous and unstructured) and known covariance among levels of random effects (e.g., pedigree and genomic relationship matrices) (Covarrubias-Pazaran, 2016; Maier et al., 2015; Jensen et al., 1997). REML estimates can be obtained using the Direct-Inversion Newton-Raphson and Direct-Inversion Average Information algorithms for the problems r x r (r being the number of records) or using the Henderson-based average information algorithm for the problem c x c (c being the number of coefficients to estimate). Spatial models can also be fitted using the two-dimensional spline functionality available.

Installation

You can install the development version of sommer from GitHub:

devtools::install_github('covaruber/sommer')

Development

The sommer package is under active development. If you are an expert in mixed models, statistics or programming and you know how to implement of the following:

  • the minimum degree ordering algorithm
  • the symbolic cholesky factorization
  • automatic differentiation
  • generalized linear models

please help us to take sommer to the next level. Drop me an email or push some changes through github :)

Copy Link

Version

Install

install.packages('sommer')

Monthly Downloads

5,864

Version

4.4.4

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Giovanny Covarrubias-Pazaran

Last Published

November 26th, 2025

Functions in sommer (4.4.4)

dfToMatrix

data frame to matrix
csm

customized covariance structure
corImputation

Imputing a matrix using correlations
MNR

Multivariate Newton-Raphson algorithm
H.mat

Combined relationship matrix H
dsm

diagonal covariance structure
covm

covariance between random effects
atm

atm covariance structure
anova.mmes

anova form a GLMM fitted with mmes
coef.mmes

coef form a GLMM fitted with mmes
ism

identity covariance structure
fitted.mmes

fitted form a LMM fitted with mmes
r2

Reliability
fixm

fixed indication matrix
mmes

mixed model equations solver
mmer

mixed model equations for r records
randef

extracting random effects
plot.mmes

plot form a LMM plot with mmes
predict.mmes

Predict form of a LMM fitted with mmes
pmonitor

plot the change of VC across iterations
summary.mmes

summary form a GLMM fitted with mmes
usm

unstructured covariance structure
vpredict

vpredict form of a LMM fitted with mmes
vsm

variance structure specification
residuals.mmes

Residuals form a GLMM fitted with mmes
unsm

unstructured indication matrix
spl2Dmats

Get Tensor Product Spline Mixed Model Incidence Matrices
spl2Dc

Two-dimensional penalised tensor-product of marginal B-Spline basis.
sommer-package

Solving Mixed Model Equations in R
Figure: mai.png
tpsmmbwrapper

Get Tensor Product Spline Mixed Model Incidence Matrices
D.mat

Dominance relationship matrix
vs

variance structure specification
vsr

variance structure specification
CS

Compound symmetry matrix
AR1

Autocorrelation matrix of order 1.
ARMA

Autocorrelation Moving average.
GWAS

Genome wide association study analysis
E.mat

Epistatic relationship matrix
A.mat

Additive relationship matrix
summary.mmer

summary form a GLMM fitted with mmer