Package: sommer 4.4.97

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., unstructured, diagonal, autoregressive, factor analytic, reduced rank, among others) and known covariance among levels of random effects (e.g., pedigree and genomic relationship matrices) (Covarrubias-Pazaran, 2016 <doi:10.1371/journal.pone.0156744>; Maier et al., 2015 <doi:10.1016/j.ajhg.2014.12.006>; 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).

Authors:Giovanny Covarrubias-Pazaran [aut, cre]

sommer_4.4.97.tar.gz
sommer_4.4.97.zip(r-4.7-x86_64)sommer_4.4.97.zip(r-4.7-arm64)sommer_4.4.97.zip(r-4.6-x86_64)sommer_4.4.97.zip(r-4.6-arm64)sommer_4.4.97.zip(r-4.5-x86_64)
sommer_4.4.97.tgz(r-4.6-x86_64)sommer_4.4.97.tgz(r-4.6-arm64)sommer_4.4.97.tgz(r-4.5-x86_64)sommer_4.4.97.tgz(r-4.5-arm64)
sommer_4.4.97.tar.gz(r-4.7-arm64)sommer_4.4.97.tar.gz(r-4.7-x86_64)sommer_4.4.97.tar.gz(r-4.6-arm64)sommer_4.4.97.tar.gz(r-4.6-x86_64)
sommer_4.4.97.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
sommer/json (API)

# Install 'sommer' in R:
install.packages('sommer', repos = c('https://covaruber.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/covaruber/sommer/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library

On CRAN:

Conda:

average-informationmixed-modelsrcpparmadilloopenblascppopenmp

13.39 score 65 stars 8 packages 564 scripts 5.7k downloads 39 mentions 76 exports 9 dependencies

Last updated from:f755907a63. Checks:13 ERROR, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64ERROR561
linux-devel-x86_64ERROR544
source / vignettesOK692
linux-release-arm64ERROR579
linux-release-x86_64ERROR464
macos-release-arm64ERROR449
macos-release-x86_64ERROR653
macos-oldrel-arm64ERROR366
macos-oldrel-x86_64ERROR483
windows-devel-arm64ERROR510
windows-devel-x86_64ERROR518
windows-release-arm64ERROR485
windows-release-x86_64ERROR308
windows-oldrel-x86_64ERROR320
wasm-releaseOK202

Exports:A.matanalyze_mme_crossoversanova.mmesantemAPYar1mar2mar3matmatrbinmcarcoef.mmescorgmcorImputationcovmcovmatrix_mmescovparams_mmescovparams_mmes_secsmcsrD.matdfToMatrixdsmdsrdsummE.matfamfamilymfitted.mmesfixmgenerate_mme_workloadGWASH.matismloadings_mmesmammaternmmeffects_mmesmetricmmme_workload_gridmmermmesmmes_controlMNRownmplot.mmespmonitorpostPEVpostVarUpredict.mmesprofile_mme_workloadr2randefresiduals.mmesrotate_back_mmesrrmrun_mme_benchmarksarscores_mmesspl2Dcspl2DmatsstackTraitsstrmsummary.mmestoeplitzmtpsmmbwrapperunsmunsm2usmusrvpredictvsvsmvsrwald_mmes

Dependencies:crayonenhancerlatticeMASSMatrixRcppRcppArmadilloRcppEigenRcppProgress

Inside sommer: the ai_mme_sp2 engine
1. The problem the engine solves | 1.1 A structured linear mixed model | 1.2 What is and is not estimated here | 2. Henderson equations and the restricted likelihood | 2.1 The coefficient matrix | 2.2 The REML objective in Henderson form | 2.3 A useful connection to the textbook score | 3. Covariance parameters: legal coordinates for optimization | 3.1 Natural values and working values | 3.2 Derivatives belong to the covariance descriptor | 3.3 Fixed parameters and covariance validity | 4. How AI-REML proposes and accepts updates | 4.1 Score, information, and an update | 4.2 Why blend AI and EM update directions? | ML posterior moments and fixed effects | AI-first recovery | Scalar parameter expansion | Direct-engine EM and recovery | 4.3 Safeguards around the proposed step | 5. Three solvers for the MME system | 5.1 solver="ldlt": sparse direct factorization | 5.2 solver="cholmod": supernodal direct factorization | 5.3 solver="pcg": iterative solves and stochastic traces | 5.4 At-a-glance comparison | 6. Structure-aware shortcuts and where the speed comes from | 6.1 Kronecker products: invert the factors, not the product | 6.2 Diagonal and repeated-block residuals | 6.3 Selected inverse instead of full inverse | 6.4 Reuse what does not change across iterations | 6.5 Matrix-free PCG for compatible REML models | 6.6 Why dense relationship matrices are a different regime | 7. The C++ numerical libraries | 8. A complete small Henderson solve: two environments and three entries | 8.1 Data, ordering, and design matrices | 8.2 The entry relationship and the supplied Ai | 8.3 The environment covariance and the full random covariance | 8.4 Assemble Henderson's equations | 8.5 What the CHOLMOD solve returns | 8.6 Quadratic form and one likelihood evaluation | 8.7 How the four covariance coordinates affect this example | 8.8 The converged fit is a different point | 8.9 What this six-observation example teaches | 9. Choosing settings and interpreting results

Last update: 2026-10-17
Started: 2026-09-28

Generalized linear mixed models with sommer
Overview | How the fit works | PQL and IRLS | Dispersion and covariance structures | Offsets and precision weights | Families and examples | Gaussian | Binomial | Poisson | Gamma | Inverse Gaussian | Quasi families | Extracting results and controlling PQL | Practical guidance

Last update: 2026-10-17
Started: 2026-09-25

Factor analytic and reduced rank models in sommer
SECTION 1: Theory | 1) Why reduce the cross-environment covariance | 2) The factor-analytic (FA) model | 3) The reduced-rank (RR) model | 4) Choosing k and comparing to other structures | SECTION 2: Fitting factor-analytic and reduced-rank models | 1) Data | 2) Factor-analytic model with fam() | 3) Reduced-rank model with rrm() | 4) Comparing FA and RR | SECTION 3: Extracting loadings, scores, and diagnostic plots | 1) Loadings and specific variances | 2) Genotype scores | 3) Why and how to rotate loadings and scores | 4) Percentage of variance explained | 5) Loadings plot | 6) Genotype scores plot | 7) Latent regression plots | 8) Heatmap of the fitted genetic correlation matrix | Literature

Last update: 2026-10-15
Started: 2026-09-23

Theory: how sommer parameterizes and optimizes covariance structures
Chapter 1: The linear mixed model and Henderson's equations | 1.1 The model | 1.2 Henderson's Mixed Model Equations (MME) | $$C\begin | 1.3 Where covariance structures come in | 1.4 Preview of the key distinction (developed in Chapter 4) | Chapter 2: Parameterization theory, explained from first principles | 2.1 Why we can't just let the computer search freely | 2.2 The working-parameter vector | 2.3 Transform family 1 — variances: the exponential map | 2.4 Transform family 2 — bounded quantities: logit and tanh | 2.5 Transform family 3 — many correlated quantities at once (factorizations) | 2.6 Why the reference level matters: avoiding scale confounding | Chapter 3: Catalog of covariance structures | 3.1 ism(x) — identity | 3.2 dsm(x, values, fixed, theta) / atm(x, levs, values, fixed) — heterogeneous diagonal variances | 3.3 csm(x, rho, fixed, variance, values) — compound symmetry | 3.4 ar1m/ar2m/ar3m/toeplitzm — autoregressive & general Toeplitz correlation | 3.5 mam/ma1m/ma2m — moving-average covariance | 3.6 corgm(x, theta, fixed) — general correlation matrix | 3.7 usm(x, theta, fixed) — general unstructured covariance | 3.8 fam(x, k, loadings, specific, fixed, variance) / rrm(x, k, loadings, fixed) — factor-analytic covariance | 3.9 antem(x, order, beta, innovations, fixed) — antedependence | 3.10 maternm(x, range, nu, fixed, distance) — Matérn spatial correlation | 3.11 sar(x, W, rho, fixed) — simultaneous autoregressive spatial covariance | 3.12 car(x, W, rho, fixed) — proper conditional autoregressive covariance | 3.13 ownm(x, K, fun, par, fixed, dfun) — user-defined shape | 3.14 covm(ran1, ran2, thetaC, theta, ...) — legacy two-random-effect helper | 3.15 Summary table | Chapter 4: REML, AI-REML, and ai_mme_sp2() | 4.1 The REML log-likelihood sommer maximizes | 4.2 The AI-REML update | 4.3 The core object: precision and its derivative | 4.4 Variance-type parameters: sparse/diagonal $B_k$ | 4.5 Correlation-type parameters: dense $B_k$ | 4.6 trust_cap: a second REML-stability mechanism tied to parameter type | 4.7 Summary: the full chain per parameter type | Chapter 5: Worked examples, one per structure | 5.1 ism() | 5.2 dsm() | 5.3 csm(), homogeneous | 5.4 csm(), heterogeneous | 5.5 ar1m() | 5.6 ar2m() / ar3m() / toeplitzm() | 5.7 mam() / ma1m() / ma2m() | 5.8 usm() | 5.9 corgm() | 5.10 fam() / rrm() | 5.11 antem() | 5.12 maternm() | 5.13 sar() | 5.14 car() | 5.15 ownm() | Chapter 6: End-to-end numerical trace, from $\eta$ to the REML objective | 6.1 A 4-observation, 2-line x 2-trait toy data set | 6.2 Step 1 — working parameters to the shape and its precision (Chapter 2-3) | 6.3 Step 2 — precision to Henderson's $C$ matrix (Chapter 1) | 6.4 Step 3 — solving the MME (BLUEs/BLUPs depend on $\eta$) | 6.5 Step 4 — from the MME solution to the REML ingredients (Chapter 4.1) | 6.6 Step 5 — perturbing $\eta$: where the score/AI-matrix machinery lives | Where to go from here

Last update: 2026-10-15
Started: 2026-09-24

Using covariance structures with sommer
SECTION 1: Covariance structures in vsm() | 1) The product-level variance scale | 2) Covariance-shaping factors | 3) Homogeneous and heterogeneous marginal variances | SECTION 2: Fitting structured models | 1) Compound symmetry | 2) Autoregressive covariance | 3) Fixing covariance parameters | SECTION 3: Complete covariance-structure catalog | 2) Combining two simple effects with covm() | 3) Covariance across several terms with strm() | 4) Equality and scaling constraints with vcc | SECTION 4: CovarianceFactor descriptors | 1) Descriptor fields | 2) Working and reported parameters | Literature

Last update: 2026-10-15
Started: 2026-09-23

Installing and configuring BLAS thread control
What the error means | Identify the R installation and BLAS | Install the appropriate R packages | Route A: R uses FlexiBLAS | Route B: R uses a recognized OpenBLAS or MKL library directly | If R still uses a reference BLAS | Verify control with a small model | Retry your model | Cluster allocations and startup configuration | Troubleshooting and interpreting usage | References

Last update: 2026-10-06
Started: 2026-10-06

Genetic evaluation with known variance components in sommer
Overview | Simulated population | Pedigree and relationship inverse | Breeding values and phenotypes | Step 1: REML on a subset of herds | Step 2: evaluation of the whole population | Accuracy of the predicted breeding values | Other ways to give the variance components | Practical notes

Last update: 2026-10-02
Started: 2026-10-02

Quantitative genetics using the sommer package
SECTION 1: Introduction | Backgrounds in linear algebra | SECTION 2: Topics in quantitative genetics | 1) Marker and non-marker based heritability calculation | 2) Specifying heterogeneous variances in univariate models | 3) Using the vpredict calculator | 3.1) Standar error for heritability | 4) Half and full diallel designs (use of the overlay) | 5) Genomic selection: predicting mendelian sampling | 6) Indirect genetic effects | 7) Genomic selection: single cross prediction | 8) Multivariate genetic models and genetic correlations | 9) Bivariate model with repeated records | SECTION 3: Special topics in Quantitative genetics | 1) Partitioned model | 2) UDU' decomposition | 3) Mating designs | North Carolina Design I (Nested design) | North Carolina Design II (Factorial design) | 4) GWAS by GBLUP | Final remarks | Literature

Last update: 2026-09-30
Started: 2025-04-01

Translating lme4 models to sommer
1) Random slopes | 2) Random slopes and random intercepts (without correlation) | 3) Random slopes and random intercepts (with correlation) | 4) Random slopes with a different intercept | 4) Other models available in sommer but not in lme4 | Literature

Last update: 2026-09-30
Started: 2025-04-01

Spatial modeling using the sommer package
1. Where does the spatial part go? | 2. The building block: AR1 correlation | 3. A single trial | 3.1 A field where we know the truth | 3.2 Five candidate models | 3.3 Comparing the models | 3.4 Reading the estimated parameters | 3.6 Reproducing SpATS with P-spline ANOVA | 4. Several trials at once | 4.1 Three simulated trials | 4.2 Shared correlations: a Kronecker product with vsm() | 4.3 Trial-specific correlations: a direct sum with dsumm() | 4.4 Which model should I use? | 4.5 Trials without spatial information: levels= | 4.6 Spatial effects on the G side for several trials | 5. Practical advice | Translating from ASReml-R | Literature

Last update: 2026-09-30
Started: 2025-04-01

Fitting genotype by environment models in sommer
1) Single environment model | 2) MET: main effect model | 3) MET: diagonal model (DG) | 4) MET: compund symmetry model (CS) | 5) MET: unstructured model (US) | 6) MET: random regression model | 7) Other GxE covariance structures | 8) Finlay-Wilkinson regression | 9) Factor analytic and reduced rank models | 10) Two stage analysis | Literature

Last update: 2026-09-28
Started: 2025-04-01

Readme and manuals

Help Manual

Help pageTopics
*So*lving *M*ixed *M*odel *E*quations in *R*sommer
Additive relationship matrixA.mat
Analyze Crossover Frontiers from MME Benchmarksanalyze_mme_crossovers
anova form a GLMM fitted with mmesanova.mmer anova.mmes
Antedependence covariance structureantem
Construct an APY Relationship Precision MatrixAPY
First-order autoregressive covariance structurear1m
Second-order autoregressive covariance structurear2m
Third-order autoregressive covariance structurear3m
Selected-level diagonal covariance structureatm
Selected-level diagonal covariance structure for 'mmer' and 'vsr'atr
Binomial proportion response with its number of trialsbinm
Proper conditional autoregressive spatial covariance structurecar
coef form a GLMM fitted with mmescoef.mmer coef.mmes
General positive-definite correlation structurecorgm
Imputing a matrix using correlationscorImputation
Covariance Between Two Random Effectscovm
Covariance and correlation matrix of a fitted term with standard errorscovmatrix_mmes
Extract native-scale covariance parameters from an mmes fitcovparams_mmes
Native-scale covariance parameters and standard errorscovparams_mmes_se
Compound-symmetry covariance structurecsm
User-specified covariance-component structure for 'mmer' and 'vsr'csr
Dominance relationship matrixD.mat
data frame to matrixdfToMatrix
Diagonal heterogeneous covariance structuredsm
Diagonal covariance structure for 'mmer' and 'vsr'dsr
Direct sum of residual covariance structures across sectionsdsumm
Epistatic relationship matrixE.mat
Factor-analytic covariance structurefam
Different distribution families for the traits of a multi-trait modelfamilym
fitted form a LMM fitted with mmesfitted.mmer fitted.mmes
fixed indication matrixfixm
Generate Parameterized MME Workloads for Solver Evaluationgenerate_mme_workload
Genome wide association study analysisGWAS
Combined relationship matrix HH.mat
Identity covariance structureism
Extract factor-analytic loadings from a fitted mmes modelloadings_mmes
Moving-average covariance structures of order one or twoma1m ma2m mam
Matern spatial covariance structurematernm
Marker effects recovered from a fitted relationship-based termmeffects_mmes
Distance-based (metric) spatial correlation structuresmetricm
Generate a Factorial Grid of MME Workloadsmme_workload_grid
*m*ixed *m*odel *e*quations for *r* recordsmmer
*m*ixed *m*odel *e*quations *s*olvermmes
Mixed Model Equation Solver Control and Experimental Optionsmmes_control
Multivariate Newton-Raphson algorithmMNR
User-defined covariance structureownm
plot form a LMM plot with mmesplot.mmer plot.mmes
plot the change of VC across iterationspmonitor
Post-fit prediction error variances and inverse coefficient matrixpostPEV
Post-fit Sampling Covariance of BLUPspostVarU
Predict form of a LMM fitted with mmespredict.mmer predict.mmes
Print method for sommer_mme_benchmarkprint.sommer_mme_benchmark
Print method for sommer_mme_crossoverprint.sommer_mme_crossover
Print method for sommer_mme_profileprint.sommer_mme_profile
Print method for sommer_mmes_controlprint.sommer_mmes_control
Profile an MME Workload by Phaseprofile_mme_workload
Reliabilityr2
extracting random effectsrandef
Residuals form a GLMM fitted with mmesresiduals.mmer residuals.mmes
Back-transform rotated mmes random effectsrotate_back_mmes
Reduced-rank covariance structurerrm
Run Experimental MME Benchmark Suiterun_mme_benchmark
Simultaneous autoregressive spatial covariance structuresar
Predict factor-analytic scores from a fitted mmes modelscores_mmes
Two-dimensional penalised tensor-product of marginal B-Spline basis.spl2Da spl2Db spl2Dc
Get Tensor Product Spline Mixed Model Incidence Matricesspl2Dmats
Stack several trait columns into the long format used by multi-trait modelsstackTraits
Covariance structure spanning several random termsstrm
summary form a GLMM fitted with mmerprint.mmer print.summary.mmer summary.mmer
summary form a GLMM fitted with mmesprint.mmes print.summary.mmes summary.mmes
General positive-definite Toeplitz correlation structuretoeplitzm
Get Tensor Product Spline Mixed Model Incidence Matricestpsmmbwrapper
unstructured indication matrixunsm unsm2
Unstructured positive-definite covariance structureusm
Unstructured covariance structure for 'mmer' and 'vsr'usr
Equality and scaling constraints between variance parametersvcc vcParams
vpredict form of a LMM fitted with mmesvpredict vpredict.mmes
variance structure specificationvs
Variance-structure model with arbitrary Kronecker covariance factorsvsm
variance structure specificationvsr
Wald tests for fixed effects with optional small-sample denominator dfprint.wald.mmes wald_mmes