Cognitive Neuroscience and Brain Function

GALAMM Models of Cognitive and Brain Development

Exploring Cognitive and Brain Development Through GALAMMs
Published: June 30, 2023 · Last reviewed:
📖2,152 words9 min read📚4 references cited
The Sørensen, Fjell, and Walhovd (2023) Psychometrika paper introduces a model class—Generalized Additive Latent and Mixed Models (GALAMMs)—that occupies a methodological position previously not bridged by mainstream statistical software. GALAMMs combine three components that have historically been developed as separate frameworks: generalized linear mixed models for clustered data, generalized additive models for smooth nonlinear effects of continuous covariates, and latent variable models for measurement-model structure with multiple indicators. Each of these alone has rich software support (lme4, mgcv, lavaan); the combination has not, and the practical consequence has been that researchers analyzing complex longitudinal cognitive-neuroscience data have had to compromise on at least one of the three to make their analysis tractable. The 2023 paper provides both the formal model class and a computational implementation that does not require the compromise.

What problem GALAMMs solve

Modern cognitive-neuroscience studies routinely produce data with all three of the structural features GALAMMs address. Clustered structure: participants are repeatedly assessed over time (within-person clustering); participants are nested within studies, sites, or families (between-person clustering); and tests are administered as batteries with shared item-level variance. Nonlinear age effects: cognitive trajectories across the lifespan are characterized by U-shaped, inverted-U-shaped, or plateau-then-decline patterns that are poorly captured by polynomial parametric forms. Latent-variable measurement: episodic memory is not directly observed but is estimated from multiple test scores; hippocampal “volume” is summarized from voxel-level MRI data; socioeconomic status is constructed from multiple income, education, and occupation indicators.

The standard analytical workflow for such data forces a sequential simplification. First, the analyst computes summary scores for the latent constructs (e.g., a CVLT total score for episodic memory). Then, those summary scores are entered into a generalized additive mixed model with smooth age effects and crossed random effects. The simplification has two costs. The summary scores discard the multiple-indicator structure that gives latent-variable estimation its measurement-error robustness. And the smooth age effects are then assumed to apply to the summary score rather than to the latent construct itself, which conflates measurement-model and structural-model age dependence.

GALAMMs estimate the full model jointly: the latent variable is constructed within the model from the multiple indicators, the smooth age effects are specified on the latent variable, and the clustered random-effects structure is preserved. The parameters of all three components are estimated simultaneously by maximum likelihood, which means measurement-error correction is built into the structural age estimates and the smoothness specification is on the construct of substantive interest rather than on a derived score.

The methodological lineage

The framework builds explicitly on three existing research programs. Wood’s (2017) Generalized Additive Models textbook is the canonical reference for the smoothing-spline machinery that GALAMMs use for nonlinear effects. The mgcv R package, which implements that machinery, has been the standard tool for GAMs in applied statistics for over a decade. GALAMMs incorporate mgcv-style penalized smoothing splines into a larger model class.

Skrondal and Rabe-Hesketh’s (2004) Generalized Latent Variable Modeling book and the associated GLLAMM (Generalized Linear Latent and Mixed Models) framework provided the most comprehensive prior synthesis of latent-variable models with mixed-effects structure. GLLAMM handles latent variables, multiple-level random effects, and a wide range of response distributions, but it does not natively support smooth nonlinear effects of continuous covariates—the GAM extension. GALAMMs add that extension, retaining GLLAMM’s flexibility on the latent and mixed-effects sides while gaining the smooth-effects flexibility on the covariate side.

The third lineage is computational. Modern fitting of complex random-effects models depends on three innovations: Laplace approximation of the marginal likelihood (which avoids the costly numerical integration that would otherwise be required for high-dimensional random-effects integrals), sparse matrix computation (which exploits the block-diagonal structure of design matrices in clustered models to reduce memory and time costs by orders of magnitude), and automatic differentiation (which provides exact gradients without requiring the analyst to derive them, enabling efficient gradient-based optimization). Sørensen et al. (2023) combine all three in their estimation algorithm, which is what makes the GALAMM class tractable for the dataset sizes typical of modern cognitive-neuroscience cohorts.

Two case studies that demonstrate the framework

The 2023 paper validates GALAMMs on two substantive applications, both drawn from the LCBC (Lifespan Changes in Brain and Cognition) consortium that the authors lead at the University of Oslo.

Case study 1: Lifespan cognitive trajectories. Three latent cognitive constructs—episodic memory (indicated by California Verbal Learning Test scores), working memory (indicated by digit span tests), and processing speed / executive function (indicated by Stroop test scores)—were modeled as smooth functions of age across the adult lifespan, with crossed random effects for participant and study site. The GALAMM specification estimates the latent constructs from their indicators and the smooth age trajectories of those constructs simultaneously. The recovered trajectories show the characteristic patterns documented in the cognitive-aging literature: episodic memory and processing speed decline relatively monotonically across adulthood, while working memory shows a more gradual decline with possibly a plateau in middle age. The methodological contribution is that these trajectories are now estimated with full measurement-error correction in a single model rather than through a multi-step workflow.

Case study 2: Hippocampal volume × socioeconomic status. The second application examines how socioeconomic status (a latent construct from multiple income and education indicators) relates to hippocampal volume (from MRI data) across the lifespan. The smooth age effects allow the SES-hippocampus association to vary nonlinearly with age, and the latent-variable specification of SES uses the full multi-indicator structure rather than a composite score. The result identifies an interaction pattern that varies in magnitude across age in ways that linear or polynomial models would not capture cleanly.

The galamm R package

The accompanying R package galamm, developed at the Lifespan Changes in Brain and Cognition center at the University of Oslo and described in detail in a 2024 companion paper in Multivariate Behavioral Research (Sørensen, 2024), is the practical mechanism by which the framework reaches applied analysts. The package is on CRAN and supports models with arbitrary numbers of crossed or nested random effects, smoothing splines, mixed response types (continuous, binary, count, ordinal), factor structures with multiple latent variables, heteroscedastic residuals, and missing-at-random data. The implementation uses the same Laplace approximation, sparse matrix, and automatic differentiation machinery described in the 2023 paper.

The release of an open-source R package alongside the methodological paper is consequential. Methods papers that introduce promising frameworks but provide no software typically take years to be adopted by the applied community. By releasing galamm with the publication, Sørensen et al. (2023) shortened that adoption lag substantially—applied researchers in cognitive aging, developmental neuroscience, and longitudinal psychometrics can fit GALAMMs without implementing the model class themselves.

Where GALAMMs fit in the longitudinal-modeling toolkit

Several existing model classes solve subsets of the problem GALAMMs address; understanding the relationships clarifies when GALAMMs add value over simpler alternatives.

Generalized linear mixed models (GLMMs) handle clustered data and arbitrary response distributions but do not natively support latent variables or smooth nonlinear covariate effects. For data without measurement-model structure or with linear age effects, GLMMs (via lme4) remain the appropriate tool.

Generalized additive mixed models (GAMMs) add smooth nonlinear effects to GLMMs but still do not handle latent variables. GAMMs (via mgcv) are appropriate when the dependent variable is directly observed and the analyst wants smooth covariate effects without the measurement-model complication.

Structural equation models (SEMs) handle latent variables and complex covariance structures but typically assume linear relationships among latent variables and observed covariates, with limited support for clustered data. Multilevel SEMs (via Mplus or lavaan) handle one or two levels of clustering but do not extend gracefully to many crossed random effects or to smooth nonlinear effects.

GLLAMMs (Skrondal & Rabe-Hesketh, 2004) generalize across GLMMs and SEMs but lack the smooth-effects extension.

GALAMMs occupy the union of all of these. The cost is that they are more demanding to specify and fit—each component adds parameters and complexity. The justification, in the cognitive-aging case study at least, is that all three components are genuinely needed for the substantive question being asked. Where one or more of the components are not needed (linear age effects suffice, or the dependent variable is directly observed, or there is no clustered structure), simpler alternatives remain preferable.

What the framework enables that was previously hard

Three classes of analyses are substantially more tractable under the GALAMM framework than under the prior multi-step alternatives.

The first is measurement invariance testing across nonlinear age effects. Whether a cognitive test measures the same construct similarly at age 30 and age 70 is a measurement-model question; whether the latent construct itself changes nonlinearly with age is a structural-model question; and the two interact when items have age-dependent loadings. GALAMMs estimate both jointly, which is required for clean inference about either.

The second is combined behavioral and neuroimaging analysis with multi-cohort consortium data. Initiatives like ENIGMA and Lifebrain combine MRI and cognitive data from many studies to boost statistical power. The data have crossed random effects (participant, study, site) and latent variables on both sides (cognitive constructs, brain-region summaries), which GALAMMs handle natively.

The third is longitudinal mediation analyses with smooth age-modified effects. Whether the relationship between a predictor and an outcome is mediated by a third variable, with the mediation strength varying nonlinearly across age, is a model that requires all three GALAMM components. Prior workarounds in this case have been particularly clumsy—typically piecewise age-stratified mediation analyses with the strata chosen post hoc.

Adoption considerations

For applied researchers considering GALAMMs over simpler alternatives, two practical points are worth flagging. The framework’s flexibility is a double-edged feature: more parameters mean more decisions about model specification (which random effects to cross, which covariates to smooth, which factor loadings to constrain) and more risk that the analyst over-fits or chooses a specification that the data cannot support. The galamm package documentation provides detailed guidance on these decisions, and the LCBC team’s published applications serve as exemplars.

Computational cost remains substantial relative to fitting GLMMs or GAMMs alone. The Laplace approximation, sparse matrix operations, and automatic differentiation make the framework tractable, but a complex GALAMM on a large multi-cohort dataset can still require hours to days of compute time. This is acceptable for analyses that would otherwise be impossible, but it is not a drop-in replacement for simpler models in cases where the simpler models suffice.

Frequently asked questions

What is a GALAMM?

A Generalized Additive Latent and Mixed Model (GALAMM) combines three model classes: generalized linear mixed models (for clustered data), generalized additive models (for smooth nonlinear effects of continuous covariates), and latent variable models (for measurement-model structure with multiple indicators). The framework estimates the parameters of all three components jointly by maximum likelihood.

When should I use a GALAMM instead of a simpler model?

Use a GALAMM when all three components are genuinely needed: clustered or longitudinal data, nonlinear covariate effects (typically age), and a latent variable estimated from multiple indicators. If only one or two of these features applies—linear age effects suffice, or the dependent variable is directly observed, or there is no clustered structure—then a simpler GLMM, GAMM, or SEM is preferable.

How does a GALAMM differ from a GLLAMM?

Skrondal and Rabe-Hesketh’s GLLAMM framework already supports latent variables, multiple-level random effects, and a wide range of response distributions. GALAMMs extend GLLAMMs by adding penalized smoothing splines for nonlinear effects of continuous covariates, with the same Laplace-approximation, sparse-matrix, and automatic-differentiation machinery used in modern GAM fitting.

What is the galamm R package?

The galamm R package, available on CRAN and developed at the Lifespan Changes in Brain and Cognition center at the University of Oslo, implements the GALAMM framework. It supports arbitrary numbers of crossed or nested random effects, smoothing splines, mixed response types, multiple latent factors, heteroscedastic residuals, and missing-at-random data.

What are typical applications of GALAMMs?

The framework is well suited to longitudinal cognitive neuroscience: lifespan cognitive trajectories estimated from test batteries with crossed participant and site random effects, brain-behavior associations using MRI summaries and latent SES, and mediation analyses with smooth age-modified effects. It is also applicable to multi-cohort consortium data (ENIGMA, Lifebrain) where measurement-model and clustering structure must be handled together.

Are GALAMMs computationally expensive?

Yes, relative to GLMMs or GAMMs alone. Even with the Laplace approximation, sparse matrix operations, and automatic differentiation that make the framework tractable, complex GALAMMs on large multi-cohort datasets can require hours to days of compute time. This is justified when simpler models cannot represent the data structure, and impractical when they can.

References

Related Research

Child Cognitive Development

Does Music Training Increase IQ?

Few claims in popular science have been as durable as the idea that music makes you smarter. The 1990s "Mozart Effect" sent pregnant women rushing…

Apr 15, 2026
Intelligence Research and Cognitive Abilities

Working Memory: Why It Matters

Working memory is the cognitive system that holds a small amount of information in mind, briefly, in a way that allows you to use it.…

Apr 13, 2026
Intelligence Research and Cognitive Abilities

The G Factor: What General Intelligence Means

The g factor — Charles Spearman's name for the common variance that runs through all cognitive tests — is the most replicated and the most…

Apr 10, 2026
Cognitive Neuroscience and Brain Function

Sleep Deprivation and Cognitive Performance

Williamson and Feyer (2000), in Occupational and Environmental Medicine, ran a deceptively simple experiment: they kept healthy adults awake for 28 hours and tested their…

Apr 8, 2026
Cognitive Neuroscience and Brain Function

Mindfulness and Cognitive Performance

Meditation has entered the mainstream cognitive-enhancement market. Corporate wellness programs, military training pipelines, schools, and clinics promote mindfulness as a way to sharpen attention, expand…

Apr 6, 2026

People Also Ask

What is interpreting differential item functioning with response process data?

Understanding differential item functioning (DIF) is critical for ensuring fairness in assessments across diverse groups. A recent study by Li et al. introduces a method to enhance the interpretability of DIF items by incorporating response process data. This approach aims to improve equity in measurement by examining how participants engage with test items, providing deeper insights into the factors influencing DIF outcomes.

Read more →
What are the link between physical activity and cognitive health?

Recent research highlights how everyday physical activity can benefit cognitive health. A study by Hakun et al. (2024) examined the short-term effects of regular physical activity on mental processing speed and working memory. Using real-time assessments, the study provides new insights into how light and moderate physical activities can promote brain health in middle-aged adults.

Read more →
What are sensorimotor variability and early cognition?

A recent study by Denisova and Wolpert (2024) investigates how early sensorimotor features relate to cognitive differences in toddlers diagnosed with autism spectrum disorder (ASD). By examining over 1,000 children with varying IQ levels, the researchers reveal how sensorimotor variability impacts behaviors linked to autism, providing valuable insights for individualized interventions.

Read more →
What are distinct genetic and environmental origins of hierarchical cognitive abilities in adult humans?

Understanding how genetic and environmental influences shape cognitive abilities remains a cornerstone of psychological research. Jiang et al. (2024) present an important study that examines these influences through a structured twin-based model. This research provides insight into how basic and higher-order cognitive functions are differentially affected by genetic inheritance and shared experiences.

Read more →
Why is background important?

Traditional models used in cognitive neuroscience often face challenges when handling non-linear relationships, mixed response types, or crossed random effects. GALAMMs were developed to address these limitations, leveraging maximum likelihood estimation techniques, including the Laplace approximation and sparse matrix computation. This method builds on advancements in computational science, allowing researchers to model intricate data structures with greater flexibility.

How does key insights work in practice?

Capturing Lifespan Cognitive Changes: The authors demonstrated how GALAMMs can model trajectories for episodic memory, working memory, and executive function. Using data from standard cognitive assessments such as the California Verbal Learning Test and digit span tests, the study provided detailed insights into age-related changes in cognitive abilities. Investigating Socioeconomic Impacts

📋 Cite This Article

Freitas, N. (2023, June 30). GALAMM Models of Cognitive and Brain Development. PsychoLogic. https://www.psychologic.online/brain-cognitive-changes-galamms/

Leave a Reply