Resources


We develop open-source software to support phylogenetic comparative analysis. Below are tools produced by the lab that are freely available for use and adaptation.


phylogp — Phylogenetic Gaussian Processes in R

phylogp is an R package for fitting continuous trait-evolution models on phylogenies using Gaussian processes. Rather than treating each evolutionary model as a separate algorithm, it frames them all as covariance (kernel) functions on the tree — so complex models can be built by combining simple components, validated analytically, and fitted in Stan by maximum likelihood or full Bayesian inference.

What it does

The package lets you compose kernels from building blocks — Brownian motion, Ornstein–Uhlenbeck, relaxed rates, rate-through-time, phylogeny plus geography, evolving slopes, Student-t residuals, and user-defined branch-wise kernels — check their validity on a given tree, and fit them with Stan via cmdstanr. Branch-wise kernels use an O(N) pruning recursion for the likelihood and an O(N) message-passing pass for exact leave-one-out densities, making it practical for large phylogenies.

Key capabilities
  • Kernel composition — add components to build any covariance structure
  • Validity checks — theory-based and numerical checks before fitting
  • Model comparison — PSIS-LOO cross-validation and exact LOO refits
  • Ancestral states & prediction — kriging on the tree for unobserved species
  • Classical benchmarks — ML fits reproduce phylolm for BM, Pagel's λ/κ/δ, OU, and early burst
Kernel gallery: correlation structures implied by six phylogenetic kernels on the same tree

Correlation between species implied by six kernels on the same tree: Brownian motion, Pagel's λ, early burst, OU, relaxed rates, and a squared-exponential kernel.

Installation

phylogp requires CmdStan for model fitting. Install it first, then the package:

# 1. Install cmdstanr and CmdStan
install.packages(c("remotes", "cmdstanr"),
                 repos = c("https://stan-dev.r-universe.dev", getOption("repos")))
cmdstanr::install_cmdstan()

# 2. Install phylogp (with vignettes — takes a few minutes)
remotes::install_github("ThomasPueschel/phylogp", build_vignettes = TRUE)

Kernel design tools work without Stan if you want to explore covariance structures before fitting.

Citation

If you use phylogp in your research, please cite:

Püschel, T.A. et al. (2024). phylogp: Phylogenetic comparative models as Gaussian processes. EcoEvoRxiv. https://doi.org/10.32942/X2D99V