==== Front Entropy (Basel) Entropy (Basel) entropy Entropy 1099-4300 MDPI 33287078 10.3390/e22111313 entropy-22-01313 Article Data-Driven Corrections of Partial Lotka–Volterra Models https://orcid.org/0000-0002-5180-7088Morrison Rebecca E. Department of Computer Science, University of Colorado Boulder, 1111 Engineering Drive, Boulder, CO 80309, USA; rebeccam@colorado.edu 18 11 2020 11 2020 22 11 131302 10 2020 16 11 2020 © 2020 by the author.2020Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).In many applications of interacting systems, we are only interested in the dynamic behavior of a subset of all possible active species. For example, this is true in combustion models (many transient chemical species are not of interest in a given reaction) and in epidemiological models (only certain subpopulations are consequential). Thus, it is common to use greatly reduced or partial models in which only the interactions among the species of interest are known. In this work, we explore the use of an embedded, sparse, and data-driven discrepancy operator to augment these partial interaction models. Preliminary results show that the model error caused by severe reductions—e.g., elimination of hundreds of terms—can be captured with sparse operators, built with only a small fraction of that number. The operator is embedded within the differential equations of the model, which allows the action of the operator to be interpretable. Moreover, it is constrained by available physical information and calibrated over many scenarios. These qualities of the discrepancy model—interpretability, physical consistency, and robustness to different scenarios—are intended to support reliable predictions under extrapolative conditions. model errorLotka–Volterra equationspartial modelsdata-driven model correctionBayesian calibration and validation ==== Body 1. Introduction In the realm of computational modeling today, scientists, mathematicians, and engineers investigate, design, optimize, and make predictions and decisions about an incredible multitude of real-world systems. In general, a computational model implements a mathematical model; the mathematical model represents the actual system in question using abstraction and simplification. In this paper, we investigate what happens when common simplifications go too far—resulting in an overly reduced or partial model—and how to account for the discrepancy between this model and the true system of interest. At the same time, these partial models still contain significant deterministic information, and they should not be thrown out entirely. Instead, we augment the partial models with a data-driven correction: we use what we know, and learn the rest. Partial models are especially common in the context of the generalized Lotka–Volterra (GLV) equations. These equations describe the interactive behavior of any number S of different species. The concentration of each species is represented by a variable xi,i=1,…S; there is one differential equation for each xi whose right-hand side (RHS) includes a linear growth rate term and nonlinear interaction terms. This framework, also called the quasipolynomial form, is canonical in dynamical systems [1] and is used to describe many types of physical systems, including reaction models for chemical kinetics [2], ecological models [3], and epidemiological models [4]. In these applied fields, modelers commonly build a partial model with only s0. The logistic equations admit solutions of the qualitative nature shown in Figure 1. Importantly, the sign of x˙ never changes over any solution curve. Given the initial condition, we could in fact solve the same system without the absolute value by choosing either (16a) or (16b); both reach stable equilibrium. Thus, the presence of the absolute value in this example does not affect the stability of the system. In general, the signs of the derivatives may change. However, we conjecture that the derivatives of all species do not change sign after a given point in time, say t* (as seen in the numerical examples in Section 5). In this case, the enriched differential equation for xi(t),t>t* is (17) x˙i=λi(ri+δi0)xi+∑j=1saijxixj where (18) λi=11+δi1,x˙i(t)<0∀t>t*11−δi1,x˙i(t)>0∀t>t*. The above does reach a stable equilibrium, as λi simply scales the overall dynamics and the interaction matrix A (still) determines the stability of the system. A more rigorous analysis of stability for these systems will be addressed in future work. For now, we note that differential equations with absolute value terms have been treated in the literature. In particular, Khan and Barton showed that, for ODEs whose RHS are a composition of analytic and absolute value functions of the state variables, the arguments of the absolute values change sign finitely many times in any finite duration [36], while Barton et al. provided a theoretical and computational framework for evaluating nonsmooth derivatives called lexicographic directional derivatives [37]. Finally, Oakley demonstrated that certain second-order differential equations with absolute values admit solutions of sets of related linear differential equations [35]. 3.3. Proof of Concept: Linear Embedded Discrepancy Operator, S=2,s=1 As an initial proof of concept, consider the S=2,s=1 case. The detailed model is (19) D=(A^,r^)=−3−1−1−2,53 and the partial model is simply P=(A,r)=(a11,r1)=(−3,5). In this case, the exact discrepancy is −x2x1, and we aim to approximate the effect of this term with (20) Δ1(x1,x˙1)=δ10x1+δ11|x˙1|. Calibration yields posterior mean values of δ¯10≈−0.837 and δ¯11≈−0.0224; further calibration details are deferred to the next section. The three models—detailed, partial, and enriched—are shown in Figure 2a; excellent agreement between the detailed and enriched models is achieved. We also show the phase diagram of the three models in Figure 2b including the 2D phase diagram from the detailed model projected onto the x1-axis. The recovered derivatives of the enriched model approximately match this projection quite well. Analogous plots are difficult to visualize in higher dimensions, but in this low-dimensional case, this projection may provide some intuition about why the enriched model behaves like the detailed model. 3.4. Other Possible Formulations There are a number of related possible formulations of the model discrepancy. Some options are the following: An affine expression up to the Nth derivative: (21) Δi=μi+∑j=0Nδijdjdtj(xi). A quadratic expression up to the Nth derivative. Let q=d0dt0(x1),…,dNdt(x1),…,d0dt0(xs),…,dNdtN(xs). Then (22) Δi=μi+∑i,js(N+1)δij(qiqj). A memory expression, such as: (23) Δi(t)=μi+βi∫s=0txi(s)ds for some βi∈R. Each of the above formulations includes an affine term μi. Whether or not such a constant term would be advantageous when all the missing dynamics terms are state-dependent is not immediately clear. Of course, one could also propose some combination of the above formulations as an embedded discrepancy operator. Investigating the numerical advantages and limitations of many such discrepancy operators is beyond the scope of the current paper. For now, numerical results are presented in Section 5 about the proposed linear embedded discrepancy operator, as described in Section 3.1. 4. Calibration and Validation This section contains all relevant details about the calibration and validation processes. First, for both of these, it is necessary to know what observations are available. 4.1. The Observations The datasets used to calibrate and validate the discrepancy model include observations from the detailed model trajectories of the s species included in the partial model. From each trajectory, T observations are taken, and there is a new trajectory for each initial condition ϕ, so that the observations can be summarized as (24) O={yijk},i=1,…,s;j=1,…,T;k=1,…,nϕ where yijk is the observation of xi(tj) given the initial condition ϕk. This observed value y* is given by the true value yt with additive measurement error ϵ: (25) y*=yt+ϵ, where the distribution of measurement error is normal: pϵ=N(0,σϵ2). Finally, this set of observations is partitioned into two sets, one for calibration and the other for validation. Let us partition as follows: (26) Calibrationdata:Oc={yijk},i=1,…,s;j=1,…,T;k=1,…,nϕc (27) Validationdata:Ov={yijk},i=1,…,s;j=1,…,T;k=nϕc+1,…,nϕ. That is, nϕc initial conditions are used for calibration, and the remaining nϕv are designated for validation, where nϕc+nϕv=nϕ. 4.2. Calibration Details The calibration is done using a Bayesian approach, and the details of the calibration problem are as follows. Prior: We set uniform prior distributions on the discrepancy parameters θ: (28) p(θ)=∏j=0,1i=1,…sp(δij), where (29) p(δij)=U(−100,0)i=1,…,s;j=0,1. (One might expect a negative lognormal distribution for these priors, and this was in fact the first choice. However, the uniform priors performed much better during the sampling process, and all of the parameter chains in Markov Chain Monte Carlo simulations were well-contained by the uniform bounds. Why the lognormal priors led to poor mixing will be investigated further in future work.) Likelihood: The likelihood is determined by the measurement error: (30) p(Oc|θ)=∏l=1,…,|Oc|pϵ(yl−yl,E) where the observations have been re-indexed from 1 to |Oc| (to avoid triple subscripts here) and yl,E is the corresponding model output from the enriched model E. Posterior: Given the prior and likelihood distributions above, the posterior distribution follows as: (31) p(θ|Oc)∝p(Oc|θ)p(θ). Specifically, the calibration is performed according to the Delayed Rejection Adaptive Metropolis (DRAM) method, introduced in [38] and implemented in the statistical library QUESO [39]. 4.3. Validation Metric Next, we must define an appropriate quantitative validation metric. First, we quantify the consistency between the enriched model output and the corresponding observation. We compute how probable the observation is as a realization of the model output. The probability of observing some y*, given the data Oc, is (32) p(y*|Oc)=∫ytpϵ(yt−y*)∫θp(yt|θ)p(θ|Oc)dθdyt. We can compare this probability to the rest of possible model outputs. In particular, we are interested in how much of the distribution corresponds to model outputs less likely than the one above in (32). This amount is exactly given by the γ-value, as defined in [15]: (33) γy*=∫y∈Sp(y|Oc)dy where S={y:p(y|Oc)≤p(y*|Oc)}. Note that a low γ-value implies that the observation is less probably an outcome of this model than most possible outcomes. In contrast, values that are not low demonstrate consistency between the model and observation. In this work, we compute the fraction of γ-values below a given threshold τ. For a more thorough introduction to γ-values and discussion of their use in model validation, see [15], and for another example of this used in practice as a validation metric, see [25]. An example of the area corresponding to this integral is given in Figure 3. In this work, we compute the integrals with a Monte Carlo approach [40]. 5. Numerical Results We now present the numerical performance of the proposed linear embedded discrepancy operator described in Section 3.1. All code—to run forward and inverse problems, generate data, and postprocess—is available here: github.com/rebeccaem/enriched-glv [41]. 5.1. Results for One Realization of the Detailed Model First, let us examine results for a single detailed and partial model. The detailed model is generated according to Algorithm 1, with the following values: (34) S=10,σB2=1,σC2=1. Then, the partial model is generated according to Algorithm 2 with s=4. In this example, the observations from the detailed model are taken so that nϕc=3, nϕv=3, T=10, and σϵ2=0.001. The entries of each initial condition vector ϕi are generated randomly from a lognormal distribution, logN(0,1). Note that 90 parameters are omitted during reduction, while only eight are introduced during enrichment. Figure 4 shows trajectories for calibration scenarios from the three models: detailed, partial, and enriched. The 50% and 95% quantiles are plotted for the enriched model output. There is an obvious discrepancy between the output from the detailed and partial models, and the enriched model is able to capture the bulk of this discrepancy. Nearly all of the observations from the detailed model are contained within the model output bounds from the enriched model. Figure 5 shows the same results, but for validation scenarios. Recall that these observations have not been used to calibrate the discrepancy operator. The output of the enriched model, at least to the eye, appears decent. The enriched model is greatly improved in comparison to the partial model alone and, similarly to the calibration scenarios, captures the bulk behavior of the detailed model in the validation scenarios. Figure 6 and Figure 7 show analogous plots for S=20, s=4. In this case, 400 parameters are omitted during reduction, while only eight are introduced during enrichment. In the above cases, there are a few observations which lie outside the predicted bounds of the enriched model. This problem must be addressed more carefully with a quantitative validation process as described in Section 4. Additionally, these results only show the performance of the discrepancy operator for a particular S and s and a single realization of (D,P). The agreement between trajectories from detailed and partial models for different choices of (D,P) are qualitatively similar, but some interesting differences appear by varying s with respect to S. In the next subsections, these statements are made more precise. 5.2. Results for Many Realizations of the Detailed Model We examine the performance of the proposed discrepancy model in the context of random forward models. To this end, three relevant concepts are detailed below. We quantify the average performance of the discrepancy models. In this sense, we compute these γ-values for trajectories from nM realizations of detailed models, where nM≫1. Note γ-values are computed with two types of data: calibration and validation data. To refer to these two types of data, we will use the variable p={c,v}, so that p=c denotes calibration data and p=v denotes validation data. We must check how well the enriched model performs both in terms of the data that has been used to calibrate it, and also in terms of data that has not. Both types are shown in Figure 8 and Figure 9. Finally, let us examine how well the discrepancy operators perform for different pairs (S,s). We fix S,s,p,nM and then compute γ-values for all type p observations over nM models, for a particular pair (S,s). Call this set of γ-values Γ(S,s,p,nM). Now let Q(S,s,p,nM,τ)={γi:γi<τ,γi∈Γ(S,s,p,nM)}. Then, the fraction of γ-values below the threshold τ is: (35) fγ(S,s,p,nM,τ)=|Q||Γ|. For example, if we want to compute fγ for all calibration data over nM model realizations, the denominator above is |Γ|=sTnϕcnM. The value fγ is plotted in Figure 8 and Figure 9, and S is fixed at 10 and 20, respectively. Along the x-axis, s ranges from 1 to S−1. The results for two values of τ—0.05 (shown in Figure 8a and Figure 9a) and 0.01 (shown in Figure 8b and Figure 9b)—are also shown. Let α=s/S. In the case that the model truly does represent the data-generating process and in the limit of infinite observations, then this fraction of γ-values below the threshold is equal to the threshold itself—that is, (36) limnM→∞fγ(S,s,p,nM,τ)=τ, when the model is a true match to the data-generating process. Indeed, fγ(10,s,c,100,τ) approaches τ as α approaches 1 (Figure 8). This suggests that the enriched model is better able to capture the behavior of the detailed one as more species are included in the partial model, as one might expect. Interestingly, in the S=20 case, fτ peaks somewhere in the middle of the plot, when α≈0.5 (Figure 9). In other words, the enriched model is poorest for moderate α, and performs best as α approaches 1. Consider that when α is low, only a few species are included in the partial model relative to the detailed one, but also consider that the discrepancy model has only those few species to modify. When α is close to one, the partial model already includes much of the detailed model, and the discrepancy model must only fill a small gap between the two. For moderate α, however, there are neither of these advantages—the discrepancy model must account for the behavior of a large enough number of species, but the partial model is still significantly lacking compared to the detailed model. At the same time, the S=10 plots do not exhibit the above behavior. Note that the S=20 cases appear to reach equilibrium more quickly that those with S=10; the time to equilibrium may influence the shape of curves in Figure 8 and Figure 9. Future work will include extensive numerical testing to better understand these results. 5.3. Relative Model Complexity A good discrepancy model should not overfit the data, and the best discrepancy model would be rich enough to capture the relevant behavior of the detailed model without adding unnecessary complexity. Although there are different ways one might measure complexity, here, we measure the number of terms introduced in the enriched model (2s) compared to those omitted from the detailed model. These omitted terms include the S2−s2 interspecific and intraspecific interaction terms, as well as the (S−s) growth rate terms. (Note that the number of terms introduced is equal to the number of enriched model parameters.) For the cases S=10,20, the absolute values are shown in Figure 10. In Figure 11, this information is presented as a ratio of terms added relative to terms omitted for various values of S. We call this ratio the relative model complexity. The relative model complexity is plotted as s/S varies from 1/S to (S−1)/S for a few different values of S. These include the two cases presented here (S=10,20). We also show the relative model complexity for two higher values of S, namely S=50 and S=100. One might be interested in how this type of model complexity would scale for much larger systems. Moreover, if one knew a priori the true value of S for some system, one could balance the effectiveness of the enriched model (as measured by fτ) against its relative model complexity. Strikingly, the enriched models introduce many fewer terms than what the partial models omit. For example, in the two specific forward models shown in Figure 4, Figure 5, Figure 6 and Figure 7, the relative model complexity is less than 0.1, yet the enriched model and observations do show surprisingly high consistency. 6. Conclusions This study is an initial step toward representing model discrepancy in nonlinear dynamical systems of interacting species. The proposed discrepancy model here is a linear operator embedded within the differential equations. The particular form is motivated by circumstances in which a set of differential equations can be converted to a set of fewer equations; in this decoupling process, more information must be introduced about the remaining set, such as memory or higher derivatives. In this work, the discrepancy model is similarly constructed by introducing more information about the partial set, namely as a linear operator which acts on the remaining variables and (the absolute values of) their first derivatives. We can examine the performance of the enriched models over two regimes: equilibrium and transient dynamics. The introduced parameters δ0 act on the state variables, directly affect the equilibrium solution, and seem to be sufficient, as the enriched models typically recover equilibria of the detailed models. On the other hand, the parameters δ1 act on the derivatives of the state, provide a type of overall scaling of the dynamics, and give an improvement but not a total correction; the enriched models recover much of the transient dynamics, but certainly not all of the discrepancy for every combination of (S,s). While the performance in the transient regime could be improved, the linear embedded discrepancy operators show promise as discrepancy models, even in scenarios that extrapolate over initial conditions. The results also bring up many new questions. For example, what is the effective dimension of the missing dynamics of the partial model? In other words, how many (and which) new random variables need to be introduced to effectively (i.e., within some tolerance) capture the error of the partial model? The initial results here suggest that the discrepancy between the partial and detailed models can, under some conditions, be adequately described with a relatively small number of discrepancy variables and parameters. An outstanding question is whether or not some estimate of this effective discrepancy dimension can be found a priori. Certainly, such an estimate would heavily rely on given knowledge of the detailed and partial models. Another avenue to explore is the design and analysis of more elaborate discrepancy representations in the generalized Lotka–Volterra setting, including those with second (or higher) derivatives, memory, nonlinear terms, or some combination of these. Of course, a trade-off exists between the richness of the discrepancy representation and the computational expense of both the forward and inverse problems. Finally, the detailed models (and thus also partial models) investigated here are quite simple; the interaction matrices are negative definite, diagonally dominant, and symmetric, with off-diagonal entries sampled from identical distributions. An immediate next step in this research is to examine the performance of linear embedded discrepancy operators after relaxing these restrictions on the random interaction matrices. Acknowledgments I would like to acknowledge Youssef Marzouk, Prakash Mohan, Bob Moser, and Todd Oliver for many helpful discussions about this work. Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Funding This research received no external funding. Conflicts of Interest The author declares no conflict of interest. Appendix A. Model Conversion A system of S coupled ordinary differential equations can sometimes be converted (decoupled) to a system of s differential equations, where s