Fitting deterministic population models to stochastic data: from trajectory matching to state-space models

Population and community ecology traditionally has a very strong theoretical foundation with well2 known models, such as the logistic and its many variations, and many modification of the classical LotkaVolterra predator-prey and interspecific competition models. More and more, these classical models are 4 confronted to data via fitting to empirical time-series, from the field or from the laboratory, for purposes of projections or for estimating model parameters of interest. However, the interface between mathematical 6 population or community models and data, provided by a statistical model, is far from trivial. In order to help empiricists make informed decisions, we here ask which error structure one should use when 8 fitting classical deterministic ODE models to empirical data, from single species to community dynamics and trophic interactions. We use both realistically simulated data and empirical data from microcosms 10 to answer this question in a Bayesian framework. We find that pure observation error models mostly perform adequately overall. However, state-space models clearly outperform simpler approaches when 12 observation errors are sufficiently large or biological models sufficiently complex. Finally, we provide a comprehensive tutorial for fitting these models in R. 14 Introduction Studying biotic interactions, measuring their strength, correlations with other traits and understanding 16 consequences of these interactions for ecological systems is at the heart of scientific ecology. Biotic interactions are at the centre of classical questions in population ecology, such as density regulation 18 (e.g., Sibly et al., 2005), but also in community ecology, including modern coexistence theory (Chesson, 2000; Godwin et al., 2020) and beyond, such as host-parasite (epidemiological parameters) and trophic 20 interactions. Importantly, interaction strengths also provide a bridge between ecology and evolution as biotic interactions directly or indirectly determine fitness. Biotic interactions are therefore central to 22 eco-evolutionary dynamics and feedbacks (Yoshida et al., 2003; Hiltunen et al., 2014). As a consequence, correct estimations of biotic interaction strengths are of great importance, be it 24 using times series from the field (e.g., Sibly et al., 2005) or from laboratory systems (Rosenbaum et al., 2019). The strength of ecology in this context is its important and solid body of theory and the availability 26 of mechanistic models. As a consequence, researchers would like to fit these models to time series data to extract the relevant parameters (e.g., Godwin et al., 2020). This exercise is not always straightforward 28 as models often consist of (coupled) differential equations, such as classical models including logistic or other limited local population growth, Lotka-Volterra-type models for interspecific competition and 30 consumer-resource dynamics or SI-type epidemiological models. Fitting such models to data is possible via multiple approaches, ranging from “naive” trajectory 32 matching (e.g. Fronhofer and Altermatt, 2015) using nonlinear least-squares or Bayesian approaches (e.g. Nørgaard et al., 2021) to state-space models that allow to explicitly take into account observation and 34 process errors (for a recent overview, see Auger-Méthé et al., 2021). Ecologists and evolutionary biologists faced with these choices may often wonder what the pros and cons or these different approaches are, 36 especially given the varying degrees of complexity of these approaches and technical skills they may require. These decisions are not made easier as the questions include multiple dimensions of complexity, 38 such as frequentist versus Bayesian approaches, discrete-time versus continuous-time models, stochastic versus deterministic models and, finally, multiple error structures. 40 Importantly, these choices can impact scientific results and conclusions. For instance, Sibly et al. (2005) used a rather simple likelihood approach to fit the θ-logistic model to population census data. 42 The authors concluded that a large array of taxa exhibit similarly shaped density-regulation functions which has important applied consequences for conservation and management. However, Clark et al. 44 (2010) could show that these results are likely flawed due to likelihood ridges (parameter combinations of similar likelihood), a problem which could have been mitigated, for instance, using a Bayesian approach 46 with informed priors.