arXiv ScienceSearch

arXiv · 2609.13333

Sequential reduction for discrete latent variables in ecological and evolutionary models using RTMB

Abstract

Statistical models of ecological and evolutionary dynamics often include latent variables that are either continuous (e.g., average body size) or discrete (e.g., numerical abundance). Mixed-type hierarchical models containing both are typically fitted using Markov chain Monte Carlo (MCMC), which can be prohibitively slow for large models. Here, we introduce an alternative in the R package RTMB that automates the sequential reduction of small groups of related discrete variables, allowing them to be efficiently marginalized. Sequential reduction is combined with automatic differentiation and the Laplace approximation to estimate parameters and predict both continuous and discrete variables. We demonstrate speed and flexibility using demographic examples (occupancy, dynamic occupancy, N-mixture, and open dynamic N-mixture models), benchmarking RTMB against JAGS and unmarked. We then develop two novel applications. The first is a multi-site open N-mixture model with a spatial latent variable governing site-specific initial abundance and recruitment, which shows that continuous Gaussian Markov random fields can be estimated jointly with discrete abundance dynamics in under a minute. The second is phylogenetic trait imputation for a published data set of female Liolaemus lizards, where we jointly impute a binary trait (viviparity), estimate its state-switching rates, and estimate its effect on a continuous trait (body size) during ancestral state reconstruction. This indicates that phylogenetic comparative methods can estimate linkages among discrete and continuous traits. We envision that intuitive and efficient specification of mixed-type models will allow more expressive representation of ecological and evolutionary dynamics.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Christopher L. Cahill, James T. Thorson, Kasper Kristensen. 2026-09-11. Sequential reduction for discrete latent variables in ecological and evolutionary models using RTMB. https://arxiv.org/abs/2609.13333

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Evolution as fitness landscape navigation: concepts, measures, and emerging questions

Fitness landscapes are mappings between genotypes, phenotypes, and fitness that shape evolution. In recent years, empirical work and theoretical models have greatly advanced our understanding of how populations navigate rugged fitness landscapes. Here, we provide a timely review of the theoretical aspects of this field. Its rapidly growing literature employs a wide range of terms, which are sometimes used ambiguously or inconsistently. We therefore begin by defining the major concepts and the field's vocabulary, highlighting our own terminology choices wherever needed. We then review key results on the relationships between epistasis, ruggedness, accessibility, and navigability for genotype-fitness maps, highlighting several complex and sometimes counterintuitive connections that have emerged. Further, we review how the conserved structural properties of the underlying genotype-phenotype map, which can lead to the formation of large connected neutral networks of genotypes, influence dynamics on fitness landscapes. We then compare the two levels to study landscape navigation: the level of genotype-phenotype maps and the level of genotype-fitness maps. Our review leads us to propose a new measure of navigability, based on evolutionary outcomes, that is broadly applicable and overcomes limitations of existing measures. Finally, we highlight examples from the smaller body of work that relaxes the common assumption of fitness-monotonic paths on static landscapes, and discuss how this can fundamentally change the nature of fitness landscape navigation. Throughout the review, we identify directions for future work to fill existing gaps and to synthesize the disparate strands of research within the field.

q-bio.PE

Best Matches in Phylogenetic Networks

Best match graphs (BMGs) were introduced in mathematical phylogenetics to describe the concept of closest relatives for related genes (leaves of rooted tree) in different organisms (defining leaf colors). We generalize this concept here to leaf-colored rooted networks, where least common ancestors are in general neither unique nor comparable. We characterize BMGs of rooted networks as those vertex-colored digraphs that are properly colored and satisfy an easy-to-check condition that we call the sicor-in-hub property. BMGs can be recognized in linear time and an explaining network can be constructed in quadratic time. Analogous results are obtained for reciprocal best match graphs (RBMGs), where an edge $\{x,y\}$ corresponds to pairs of vertices with different color that are mutually closest relatives.

q-bio.PE

Exact Counts of Binary Phylogenetic Networks with Four Reticulations

Phylogenetic networks provide a flexible framework for representing reticulate evolutionary processes, such as hybridization, introgression, recombination, and horizontal gene transfer. However, their combinatorial complexity makes even basic enumeration problems difficult. Building on our previous work for networks with up to three reticulations, we derive an explicit closed-form formula for the number of unrestricted rooted binary phylogenetic networks with four reticulations on \(n\) labeled taxa. Our approach is based on tree-component graphs. We classify the 79 possible component graphs corresponding to networks with four reticulations into ten groups. We then enumerate the networks associated with each group by combining known counts of one-component networks, forests, and networks with fewer reticulations. Summing these contributions yields the desired formula. This result extends the exact enumeration of unrestricted binary phylogenetic networks to four reticulations and further demonstrates the effectiveness of component graphs for systematically organizing and counting increasingly complex network classes.

q-bio.PE