Search for a command to run...
Fossilized organisms only represent a small fraction of Earth's evolutionary history, motivating "ancestral state reconstruction" techniques for inferring unobserved phenotypes of evolving lineages based on measurements of their relatives. Stochastic character mapping has emerged as a particularly powerful approach in this regard, allowing researchers to sample histories of discrete variables on phylogenies and better account for the inherent uncertainty of reconstructed ancestral states. Here, we generalize stochastic character mapping to work with continuous variables by developing an efficient algorithm for sampling evolutionary histories under Brownian Motion models with the flexibility to include multiple correlated phenotypes, measurement error, and/or among-lineage variation in evolutionary rates/trends. We implement this "continuous stochastic character mapping" procedure in a new R package called contsimmap and demonstrate potential applications of this technique by developing a novel pipeline for inferring relationships between rates of continuous trait evolution and continuously-varying factors (e.g., body size, generation time)-a difficult statistical problem for which relatively few methods are available. After verifying this pipeline's performance on simulated data, we use it to show that smaller eucalypt trees tend to exhibit higher rates of flower and leaf trait evolution overall, aligning with well-established predictions based on life history theory as well as empirical patterns in other systems. Ultimately, continuous stochastic character mapping is a valuable new tool for analyzing macroevolutionary data, enabling rigorous yet flexible investigation of complex evolutionary dynamics involving continuous traits and/or continuous variables hypothesized to affect evolutionary processes.