# Nutrigonometry I: using right-angle triangles to quantify nutritional trade-offs in multidimensional performance landscapes

Juliano Morimoto, Pedro Conceição, Christen Mirth, Mathieu Lihoreau

► To cite this version:

Juliano Morimoto, Pedro Conceição, Christen Mirth, Mathieu Lihoreau. Nutrigonometry I: using right-angle triangles to quantify nutritional trade-offs in multidimensional performance landscapes. The American Naturalist, 2023, 201 (5), pp.725-740. 10.1101/2021.11.25.469978 . hal-03857974

HAL Id: hal-03857974

https://hal.science/hal-03857974

Submitted on 17 Nov 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
1 Nutrigonometry I: using right-angle triangles to quantify nutritional trade-offs in

2 multidimensional performance landscapes

3 Authors: Juliano Morimoto¹*, Pedro Conceição², Christen Mirth³, Mathieu Lihoreau⁴

4 Authors’ affiliations:

5 ¹School of Biological Sciences, University of Aberdeen, Zoology Building, Tillydrone Ave,

6 Aberdeen AB24 2TZ

7 ²Institute of Mathematics, University of Aberdeen, King's College, Aberdeen AB24 3FX

8 ³School of Biological Sciences, Monash, University, Melbourne, Victoria, Australia

9 ⁴Research Center on Animal Cognition (CRCA), Center for Integrative Biology (CBI);

10 CNRS, University Paul Sabatier – Toulouse III, France.

11

12 * Correspondence:

13 Dr Juliano Morimoto

14 juliano.morimoto@abdn.ac.uk

15 Running-title: Trigonometry to measure fitness trade-offs

16 Keywords: Nutritional Geometry, trigonometry, lifespan-reproduction trade-off, fitness

17 maps, *Drosophila melanogaster*

18

19 Authors’ contributions

20 JM conceptualised the nutrigronometry model, coded the scripts to conduct the analysis, and

21 wrote the first draft of the manuscript. JM and PC implemented the use of persistence

22 homology. All authors contributed to the revising and editing of the manuscript and approved

23 its submission.

24

25
26 Abstract

27 Animals regulate their diet in order to maximise the expression of fitness traits that often
28 have different nutritional needs. These nutritional trade-offs have been experimentally
29 uncovered using the Geometric framework for nutrition (GF). However, current analytical
30 methods to measure such responses rely on either visual inspection or complex models
31 applied to multidimensional performance landscapes, making these approaches subjective, or
32 conceptually difficult, computationally expensive, and in some cases inaccurate. This limits
33 our ability to understand how animal nutrition evolved to support life-histories within and
34 between species. Here, we introduce a simple trigonometric model to measure nutritional
35 trade-offs in multidimensional landscapes ('Nutrigonometry'). Nutrigonometry is both
36 conceptually and computationally easier than current approaches, as it harnesses the
37 trigonometric relationships of right-angle triangles instead of vector calculations. Using
38 landmark GF datasets, we first show how polynomial (Bayesian) regressions can be used for
39 precise and accurate predictions of peaks and valleys in performance landscapes, irrespective
40 of the underlying structure of the data (i.e., individual food intakes vs fixed diet ratios). Using
41 trigonometric relationships, we then identified the known nutritional trade-off between
42 lifespan and reproductive rate both in terms of nutrient balance and concentration.
43 Nutrigonometry enables a fast, reliable and reproducible quantification of nutritional trade-
44 offs in multidimensional performance landscapes, thereby broadening the potential for future
45 developments in comparative research on the evolution of animal nutrition.
46
47
48

46

47

48
49 **Introduction**

50 Animals often require different nutrient blends to maximize concurrent life-history traits,
51 creating the potential for a conflict between nutrient allocation (Simpson and Raubenheimer
52 2012; Raubenheimer and Simpson 2020). When the optimum nutrition for several traits
53 cannot be achieved simultaneously, a compromise in feeding decisions must exist in order to
54 support the expression of one trait over another ('nutritional trade-off') (Lee et al. 2008;
55 Maklakov et al. 2008). Previous research has identified nutritional trade-offs between
56 lifespan and reproduction or between immunity and reproduction across many different taxa
57 including *D. melanogaster* (Lee et al. 2008; Ponton et al. 2015), tephritid fruit flies (Fanson
58 and Taylor 2012; Fanson et al. 2012), crickets (Maklakov et al. 2008; Rapkin et al. 2018; Guo
59 et al. 2021; Treidel et al. 2021) and mice (Solon-Biet et al. 2014) [see also reviews by
60 (Ponton et al. 2011; Schwenke et al. 2016)]. Even traits related to different aspects of the
61 same life-history can vary in nutritional requirements during the lifetime of an animal, as
62 seen for pre- and post-mating traits related to reproduction of many insect species such as
63 sperm number and viability (Bunning et al. 2015), fertilization success across sperm
64 competitive contexts (Morimoto and Wigby 2016), cuticular hydrocarbons, courtship song
65 and sperm viability (Ng et al. 2018) as well as size and numbers of eupyrene and apyrene
66 sperms (Gage and Cook 1994). Thus, nutritional trade-offs are likely ubiquitous and impose
67 significant constraints on the feeding behaviour of individuals.
68

68

69 Measuring nutritional trade-offs can be challenging because of the interactive effects of
70 nutrient ratios and concentrations on the expression of life-histories (Stearns 1992; Roff
71 2002; Hunt et al. 2004; Simpson and Raubenheimer 2012). In the last decades, however, a
72 method known as Geometric Framework of Nutrition (GF) has emerged as a powerful
73 unifying framework capable of disentangling the multidimensional effects of nutrients (both
ratios and concentrations) on life-history traits and fitness (Simpson and Raubenheimer 1993a). The GF has been applied to a diverse range of nutritional studies across species such as flies (Lee et al. 2008; Reddiex et al. 2013; Jensen et al. 2015; Ponton et al. 2015; Morimoto and Wigby 2016; Kutz et al. 2019) (Fanson and Taylor 2012; Fanson et al. 2012) (Barragan-Fonseca et al. 2018, 2021), crickets (Ng et al. 2018) (Rapkin et al. 2018) (Maklakov et al. 2008), cockroaches (Bunning et al. 2015), domestic cats and dogs (Hewson-Hughes et al. 2011, 2013), and mice (Solon-Biet et al. 2014; Morimoto et al. 2019), being paramount for advancing our understanding of complex physiological and behavioural processes across ecological environments and even human health (Simpson et al. 2017). As a result, developing a simple, intuitive, and accurate quantitative method for quantifying nutritional trade-offs has become a key issue for comparative nutrition, which will allow new avenues of research for insights into the evolution of physiological and behavioural modulation of nutritional responses (Morimoto and Lihoreau 2020).

Recent initiatives have been made but these are complex to navigate and therefore studies continue to be published with visual inspection or with inaccurate methods to quantify the strength of nutritional trade-offs in GF landscapes [e.g., (Polak et al. 2017; Ng et al. 2018, 2019; Kutz et al. 2019; Ma et al. 2020; Barragan-Fonseca et al. 2021)]. Why is it so difficult to measure nutritional trade-offs in GF multidimensional fitness landscapes? The fundamental limitation in all models so far is identifying and delimitating the region of interest (i.e., peaks and, to a lesser extent, valleys) for comparisons of distances between peaks of different traits (or same trait between species). For instance, (Rapkin et al. 2018) proposed the use of regression slopes (rather than the coordinates of the optimum) nutrients onto the fitness trait *i* as coordinates of a vector $\vec{v}_i$. From this, the angle $\theta'$ between vectors $\vec{v}_i$ and $\vec{v}_j$ for traits *i* and *j*, respectively, can be calculated as the estimate of the strength of the
99 nutritional trade-off. However, in this approach, the domain of each vector coordinate is all
100 real numbers ℝ even though the domain of the fitness landscape is constrained to all positive
101 real numbers ℝ⁺. Consequently, this violates the domain constraints of the nutritional space
102 upon which GF is performed, which in turn result in overestimation of the strength of
103 nutritional trade-offs (Morimoto and Lihoreau 2019). To address this limitation, we proposed
104 to use the coordinates of the peak (or valley) from the nutritional space as vector coordinates
105 for the position vector $\vec{v}_i$, from which the angle $\theta$ between position vectors $\vec{v}_i$ and $\vec{v}_j$ for traits
106 $i$ and $j$, respectively, can be estimated as measure of the strength of the nutritional trade-off.
107 This overcomes the violation of domains between vector coordinates and the nutritional
108 space [in (Rapkin et al. 2018)] and therefore ensures that the estimate of $\theta$ is calculated in the
109 same domain of the GF fitness landscapes. However, this Vector of Positions approach relies
110 on the peak estimates from a SVM machine learning model which is computationally
111 expensive particularly in $n$ dimensions, where $n > 3$, and sensitive to the characteristics of the
112 input data (e.g., if the data contains food intakes as in (Lee et al. 2008; House et al. 2015;
113 Jensen et al. 2015; Morimoto and Lihoreau 2019) or a grid of fixed diet ratios as in (Kutz et
114 al. 2019)], identifying local as well as global peaks that introduce noise into the analysis
115 (shown here). Albeit useful, the Vector of Positions approach can be cumbersome to
116 implement across different datasets, computationally expensive to obtain estimates of peaks
117 (or valleys), and as a result can generate inaccurate estimates of the strength of nutritional
118 trade-offs. Thus, to date, there are no proposed solutions that address the above limitations,
119 which creates a significant bottleneck in studies of nutrition that limits the multidimensional
120 power of the GF framework.

121

122 Here, we address the limitations of current models by proposing a simpler framework
123 (Nutrigonometry) upon which the strength of nutritional trade-offs can be calculated in 3D
124 fitness landscapes, irrespective of the structure of the nutritional data to analyze. Using
125 landmark GF datasets, we first investigated the performance of different ‘off-the-shelf’
126 machine learning models in predicting the peak in the fitness landscapes, in order to find the
127 most accurate and computationally inexpensive model. We achieved this by integrating
128 several measurements of predictive error, variance in predicted peak area, and topological
129 characteristics of the predicted peak region. Next, we used simple trigonometric functions
130 and relationships to estimate the strength of nutritional trade-offs both in terms of nutrient
131 balance as well as nutrient concentration, or both. Our approach opens new avenues of
132 research in multidimensional nutrition, and allows for physiological and comparative studies
133 to be performed in a consistent and reproducible way from which insights onto the evolution
134 of animal nutrition can be gained across the tree of life.

135

136 **Material and Methods**

137 *Nutrigonometry*

138 Studies using GF define the food components (typically macro-nutrients) that will be
139 investigated, which together compose the ‘nutritional space’. For example, in studies where
140 protein and carbohydrate effects are investigated, there is a 2D nutritional space (one
141 dimension for each nutrient) onto which the performance landscape of the trait is mapped.
142 This rationale can be extended to *n* number of nutrients (Simpson and Raubenheimer 1993b),
143 albeit to date, studies with two nutrients are the most common (Morimoto and Lihoreau
144 2020). If we consider this 2D nutritional space as a rectangular space in which an infinite
145 number of nutritional rails (i.e., imaginary lines that pass through the origin with arbitrary
146 positive slope) exist that divides the space in right-angle triangles, then it is possible to use
147 simple trigonometric functions to estimate the angle αᵢ and the hypothenuse of the triangle,
148 for all fitness traits mapped onto the nutritional space. The angle αᵢ is the angle of the
149 nutritional rail, relative from the x-axis, that passes through the peak in the landscape for the
150 trait *i*, and the hypothenuse *h*<sub>*i*</sub> of the triangle shows how far from the origin the peak in the
151 landscape sits for the trait *i* (Fig 1a). α<sub>*i*</sub> and *h*<sub>*i*</sub> can be calculated using Pythagorean theorem
152 and the relationship between the angle and the sides of right-angle triangles (i.e., sines and
153 cosines), as shown in Fig 1a.

154
155 Once αᵢ are known, we can estimate the angle θ [as in (Morimoto and Lihoreau 2019)] which
156 is the difference in the angle between nutritional rails that maximize two traits, i and j, and
157 provides a measure of the strength of the nutritional trade-off that exists between traits i and j
158 (Fig 1b). The larger the angle θᵢⱼ, the strongest the nutritional trade-off in terms of nutrient
159 balance (and potentially nutritional compromise) between traits. Likewise, we can compare
160 the difference hᵢⱼ in the estimates of the hypothenuse hⱼ and hᵢ to quantify nutritional trade-
161 offs in relation to nutrient concentration (Fig 1b). These metrics allowed us to disentangle the
162 following scenarios in which nutritional trade-off can occur:

163 (I) When θᵢⱼ is large but hᵢⱼ is small ('Strong nutritional trade-off in terms of
164 nutrient balance')

165 (II) When θᵢⱼ is small but hᵢⱼ is large ('Strong nutritional trade-off in terms of
166 nutrient concentration'),

167 (III) When θᵢⱼ and hᵢⱼ are large ('Strong nutritional trade-off in terms of both
168 nutrient balance and concentration')

169 (IV) When θᵢⱼ and hᵢⱼ are small ('Weak or no nutritional trade-off') (Fig 1c).

170
171 Here when applying this model for empirical datasets (see below), inferences on the strength
172 of nutritional trade-offs were made using confidence intervals for *h*<sub>*i*,j</sub> and *θ*<sub>*i*,j</sub>, whereby
173 nutritional trade-offs were stronger when confidence intervals did not overlap zero and the
magnitude of the difference was large. Estimates are presented in the units of the nutrient space in which the data was collected (e.g., mg), while angles are presented in degrees. Confidence intervals for both $h_{i,j}$ and $\theta_{i,j}$ were calculated using the significance threshold of 0.05 and the quartiles of a t-distribution. All analyses and plots were done in R version 3.6.2 (R Core Team 2019).

## Predicting peak (or valley) location and size

As with previous approaches, the model presented here depends on accurate estimates of the coordinates for the peak in the multidimensional performance landscape. Without this, estimates of $h_{i,j}$ and $\theta$ are inaccurate which in turn affects the ability of the model to estimate the strength of nutritional trade-offs. To overcome this, the basic algorithms underpinning the identification of peak regions in multidimensional fitness landscapes were designed as following:

1. Empirical data was split into training (75%) and test (25%) datasets;

2. A machine learning model was fitted to the training set using 10-fold cross-validation, with the fitness trait as dependent variable and the nutrient intakes (or fixed ratios) as independent variables. The model included main and interactive effects of protein and carbohydrate, as well as quadratic effects of each nutrient (for non-linear relationships);

3. The model's predictive performance was evaluated with root-mean-square-error (RMSE) with respect to the observed values of the test dataset;

4. A set of 500 random points corresponding to (protein, carbohydrate) coordinates were generated covering the nutritional space, and the model of step 2 was used to predict the value of the fitness value for each point;
198 5) A quantile threshold was used to crop the data to the specific region of interest. For
199 instance, for peaks in the nutritional landscape, the default value used throughout this
200 study was set to 0.95 (i.e., the highest 5% predicted fitness values are subset, from
201 which coordinates of protein and carbohydrate are used).

202 6) Steps 4-5 were repeated 100 times.

203 We then made statistical inferences on peak area from 95% confidence intervals using the 'ci'
204 function of the 'Rmisc' package (Hope et al. 2013) whereby we resampled with replacement
205 the selected random points obtained from steps 5 and 6 above. To test the performance of
206 nutrigonometry in estimating nutritional trade-offs, we used the most commonly used models
207 to test relationships between traits in behavioral ecology (e.g., general linear model), machine
208 learning models used in regression models in ecology and evolution [e.g., Random Forest,
209 (Rabinovich 2021)], as well as models that have been specifically used to analyse
210 multidimensional performance landscapes in GF studies (e.g., SVM, GAMs) (Ponton et al.
211 2015; Morimoto and Lihoreau 2019). In particular, we tested the performance of Bayesian
212 linear regression (Bayes), general linear regression (LM), k-nearest neighbors (KNN),
213 Gradient boost (GBoost), random forest (RF), support vector machine (SVM) with radial
214 basis function as well as generalized additive models (GAMs) with both smooth term or
215 tensor product term. With the exception of GAMs that were fitted using the 'mgcv' package
216 (Wood and Wood 2015), all other models were fitted using the 'tidymodels' package of the
217 tidyverse (Wickham et al. 2019). For the Bayesian regression, we used the flexible Cauchy
218 prior from the 'rstanarm' package for all analysis (Goodrich et al. 2020). Fitness landscapes
219 were estimated using the 'Tps' function of the 'fields' package (Nychka et al. 2017). All plots
220 were done using the 'ggplot2' package (Wickham 2016). All models were fitted to a training
221 set (75% of the data) and model performance (i.e., RMSE) was calculated from the
222 performance of the models in the remaining test dataset (25%).
223

224 **Goodness-of-estimate of the models**

225 In addition to RSME, we estimated the area (in squared units in which the data is collected)
226 of the polygon delimited by the estimated predicted peak region ('Area') and the horizontal
227 (protein) and vertical (carbohydrate) spread of the datapoints of the predicted peak region
228 ('Nutrient spread') as proxies of the goodness-of-estimate of the models (Fig 1d). The smaller
229 the RMSE, the better is the model in predicting the fitness value of the peak region (the z-
230 axis). Furthermore, the smaller the area and nutrient spread, the more compact the prediction
231 of the peak region in the nutritional space. Note that RMSE values do not interfere with
232 accuracy of estimates of $h_{i,j}$ and $\theta$, and thus the estimates of nutritional trade-offs, because
233 the z-axis is not used in the calculation of angles and hypothenuses (Fig 1d). A model can
234 have high RMSE and still be the best predictive model as long as the predicted peak correctly
235 matches with the observed peak in the landscape.

236

237 **Topological structure of the estimated peak**

238 Even in cases where area and nutrient spread of the predicted peak region are small, it is
239 important to have evenly-spaced datapoints within the predicted peak region. This is because
240 predictions of regions which contain holes can lead to mis-estimation of the strength of
241 nutritional trade-offs by potentially adding noise to the set of protein and carbohydrate
242 coordinates used to calculate $h_{i,j}$ and $\theta$. We measured the topological structure of the
243 predicted peak region using the concept of persistence homology (PH), which in simple
244 terms, allows us to investigate the overall structural organisation of the data [see Text S1 and
245 (Zomorodian and Carlsson 2005; Weinberger 2011) for details of the concept] (Fig 1d). PH
246 was estimated using the 'TDAstats' package (Wadhwa et al. 2018). Together, the estimates of
247 RMSE, area, nutrient spread, and PH provided a comprehensive suite of metrics to assess the
248 quality of model predictions for the peak region in fitness landscapes.

249

250 **Datasets used for model application**

251 We demonstrate the applications of the Nutrigonometry framework using two datasets, which
252 vary in structure. The first dataset is a landmark dataset which contains *Drosophila*
253 *melanogaster* individual adult nutrient intake as well as the consequences of nutrient intake to
254 lifespan and reproduction (Lee et al. 2008). This dataset was previously used to test the
255 Vector of Position approach and therefore has important benchmark status in the field
256 (Morimoto and Lihoreau 2019). We also investigate the effect of data structure on
257 Nutrigonometry estimates of peak and valley regions. In GF, data can be divided into two
258 structures: intake data and fixed ratio data. Intake data is ideal in GF studies because it allows
259 for exploration of *realized* nutritional effects, that is, nutritional effects exerted upon traits
260 given by the amount of nutrient eaten (Simpson and Raubenheimer 1993b). However,
261 collecting intake data can be cumbersome or challenging, and recent approaches have
262 adapted GF experiments to draw landscapes of traits based on the fixed ratio of the nutrients
263 in the diets (Kutz et al. 2019). To date, however, we still do not know how this adaptation
264 influence estimates of nutritional trade-offs in multidimensional performance landscapes.
265 Here, to test whether the structure of the data is important for model predictions, we used Lee
266 et al., (2008) dataset with individual intakes ('intakes') as well as with fixed ratios ('fixed').
267 Using this data and for the purpose of the demonstration of Nutrigonometry, we estimated the
268 nutritional trade-off between lifespan and reproductive rate which are known to trade-off in
269 this species. We also used a second dataset from (Kutz et al. 2019), which studied how
270 temperature modulates nutritional responses of larval development and adult fitness in *D*.
271 *melanogaster*, as an additional proof-of-application of our model in fixed ratio datasets (see
272 Fig S1). Lastly, we demonstrated how the best performing models in our peak analysis can be
273 used to predict valley regions (Fig S2 and Fig S3).

274

275 **Comparison with intake target**

276 *Drosophila melanogaster* balance their nutrient intake to a P:C ratio of 1:4 when given the
277 possibility to self-select multiple nutritionally complementary foods (Lee et al. 2008). We
278 then used the peak predictions of the Nutrigonometry framework to test whether the observed
279 P:C ratios that maximized lifespan and reproductive rates coincided with the P:C ratio of 1:4
280 reached by flies in choice situations. To achieve this, we calculated the 95% confidence
281 interval as described for the peak area but in this case, for the P:C ratio of each trait.
282 Whenever the confidence interval overlapped 1:4, we inferred that the estimate of peak ratio
283 did not statistically differ from the intake target of 1:4.

284

285 **Results**

286 *Simple (Bayesian) linear regressions outshine machine learning models when predicting*
287 *peak region in multidimensional landscapes*

288 All models generated predictions of peak region in nutritional landscapes irrespective of data
289 structure although the accuracy and topology of the predicted regions varied (Fig 2 and Fig
290 3). In general, GAMs with tensor product and smooth function as well as Bayes and LM
291 linear models generated peak predictions for both lifespan and reproductive rate that were
292 significantly more accurate (narrower in area) than other models when the structure of the
293 data was composed of food intakes (Fig 2, Table S1 and Table S2). When the data structure
294 changed to fixed ratios, LM, GAM with tensor product, Bayes, and KNN predicted peaks
295 with smaller area for lifespan and all but KNN perform within similar scales for the peak
296 prediction of reproductive rate (Fig 2, Table S1 and Table S2). In comparison, GAM smooth
297 did not perform well in predicting peak region that was homogenous and accurate to the
298 performance landscape, particularly when the data structure was fixed ratio. The performance
299 of the models was independent of patterns in the estimates of RMSE and nutrient spread
300 which showed no clear pattern of performance with the exception of LM and Bayes that
301 displayed consistently lower spread when the structure of the data were intakes (Fig 3 and Fig
302 4; Table S2). Interestingly, machine learning models consistently underperformed, predicting
303 peak regions that were wider and less accurate and homogenous (Fig 2 and 3, Table S1 and
304 S2). The underlying reason for this is unclear, but similar patterns were observed when
305 predicting the peak region of (Kutz et al. 2019) dataset (see Fig S1 and Table S3). Bayes,
306 GAMs (both smooth and tensor product) and LM also performed well when predicting valley
307 regions (see Fig S2 and S3). These results indicate that simple (Bayesian) linear regression
308 provide consistently the best models to estimate the region of the peak of fitness landscapes
309 irrespective of the structure of the data, and that GAMs with tensor product (and to a smaller
310 extent, smooth function) can be used when the data are individual intakes.
311

312 Better models lead to accurate estimates of known nutritional trade-offs in
313 multidimensional landscapes

314 GAMs (both smooth and tensor product), Bayes, LM, and KNN models were the only models
315 that correctly identified the nutritional trade-off measured by θ between lifespan and
316 reproductive rate for data with individual intakes (Table 1). Given the variability in the area,
317 spread, and topology of the predicted region, estimates of hᵢⱼ and θ were more accurate
318 (narrower confidence intervals) for GAMs (smooth and tenor product), Bayes and LM
319 compared with KNN. GAMs, Bayes and LM were the only ones that identified a trade-off on
320 the hypothenuse estimate hᵢⱼ for data of individual intakes, while KNN was the only model
321 that identified this trade-off in data with fixed ratio. GAM smooth was the only model that
failed to identify this trade-off when the data was composed of fixed ratios (Table 1). Thus, overall, simpler models are more suitable to generate peak predictions that accurately describe nutritional trade-offs in multidimensional performance landscapes for data of different structures.

326

### 327 Comparing trait optimum with intake target

We then used the estimated peak regions for lifespan and reproductive rate (both individual intake and fixed ratio data structures) to estimate the optimum P:C ratio that maximises each trait as well as whether or not these optima coincided with the P:C ratio obtained when individuals are allowed to balance their diet (i.e., 1:4). All models predicted a significantly lower P:C ratio for the optimum that maximizes reproductive rate relative to lifespan as expected from the original visual comparison of landscapes (around 1:2 for reproductive rate and >1:9 for lifespan) (Table 2). However, none of the estimates overlapped 1:4, suggesting that *D. melanogaster* females likely have to compromise the nutrient intake to maximise either lifespan or reproductive rate, but not both simultaneously.

337

### 338 Discussion

We proposed a new simple analytical framework to analyse nutritional trade-offs in multidimensional fitness landscapes. Nutrigonometry uses trigonometric relationships from right-angle triangles to identify and compare peaks (or valleys) in 3D fitness landscapes between traits. Using landmark GF datasets with different structures, we demonstrated the accuracy and performance of standard (machine learning) models in finding the peak regions in these multidimensional landscapes and subsequently quantifying the strength of nutritional trade-offs between traits. As with the Vector of Positions approach (Morimoto and Lihoreau 2019), the Nutrigonometry strictly considers coordinates in the real positive region of the
347 nutrient space, whereby the true separation between key regions (peaks and valleys) are
348 quantified within the correct domain in which the fitness landscapes exist. However, contrary
349 to previous methods (Rapkin et al. 2018; Morimoto and Lihoreau 2019), the Nutrigonometry
350 does not rely on vector calculations but instead harnesses the trigonometric relationships of
351 right-angle triangles to estimate nutritional trade-offs. This is a major advance of the model
352 as it considerably simplifies the framework both in conceptual and computational terms.
353 Nutrigonometry thus significantly advances our ability to generate reliable and reproducible
354 estimates of nutritional trade-offs within and between species, facilitating quantitative
355 (comparative studies) of animal nutrition.

356

357 Multidimensional studies of nutrition through the GF have been increasingly used to gain
358 insight into animal and human nutrition (Lee et al. 2008; Behmer 2009; Felton et al. 2009;
359 Simpson and Raubenheimer 2012; Hewson-Hughes et al. 2013; Gosby et al. 2014; Solon-
360 Biet et al. 2014). Likewise, the complexity of the applications has also increased, ranging
361 from studies with few nutrients (e.g., protein and carbohydrates, salts) through to high-
362 dimensional studies investigating individual fatty acids and amino acids (Simpson et al. 2006;
363 Grandison et al. 2009; Arien et al. 2015; Arganda et al. 2017; Piper et al. 2017). This means
364 that analytical frameworks that are simple and robust must be developed to support the
365 development of the field. Nutrigonometry provides such foundation, by demonstrating the
366 best approach to investigate nutritional trade-offs in 3D fitness landscapes. Because
367 Nutrigonometry uses trigonometric relationships of right-angle triangle, it is applicable to n
368 dimensions. However, given the often counter-intuitive geometrical effects of high
369 dimensionality [e.g., (Milman 1998; Watanabe 2021)], such expansion to higher dimensions
370 requires further investigation as the topic of future developments. Nevertheless, given the
371 broad use of 3D fitness landscapes in GF studies (Morimoto and Lihoreau 2020),
372 Nutrigonometry readily enables important quantifications of nutritional trade-offs that were
373 otherwise absent or cumbersome to produce. For instance, using a range of models,
374 Nutrigonometry uses right-angle triangles to compare the ratio of nutrients that maximise
375 lifespan and reproductive rate along with the strength of nutritional trade-offs between these
376 traits in a landmark paper in the field (Lee et al. 2008). Moreover, Nutrigonometry is capable
377 of comparing the nutrient ratio which maximises lifespan and reproductive rate with the
378 nutrient ratio that is balanced by individuals when given a choice, providing important
379 insights into the dietary choices underpinning nutritional compromises. Such quantification
380 can bring new fundamental insights into our understanding of nutritional trade-offs such as
381 strength and the direction of the trade-offs (e.g. nutrient balance vs concentration, see Fig. 1),
382 as well as how much animals actually resolve these trade-offs when they have the opportunity
383 to do so and whether, for instance, they favour one trait of another (distance between optimal
384 trade-off and observed nutrient intake target, see Table 2).

385

386 An important trend in the field of multidimensional nutrition is the study of nutritional effects
387 across physiological pathways and across levels of biological organization (Lihoreau et al.
388 2014; Simpson et al. 2015). These studies generate multiple 3D landscapes that are often
389 compared visually, without rigorous analytical methods to measure nutritional trade-offs. For
390 example, eleven 3D-landscapes of the expression of genes involved in the Insulin/IGF
391 pathway were visually compared to provide insights into how a key endocrine pathway is
392 regulated based on nutrient intake, and how gene expression can underlie expression of life-
393 histories (Post and Tatar 2016; McDonald et al. 2021). Likewise, twelve 3D-landscapes with
394 gut microbial diversity or abundance were visually compared to better understand how
395 nutrient composition can modulate host-microbe interactions (Ng et al. 2019). Similar visual
396 comparisons have been made to understand the effects of nutrition on host-endosymbiont
397 relationship (Ponton et al. 2015). The analytical framework proposed here will allow
398 researchers to move beyond visual comparisons to quantitatively assess how landscapes
399 differ using a rigorous and reproducible framework. As a result, Nutrigonometry yields
400 considerable advances to the status quo in the field, enabling a deeper understanding of the
401 role of nutrition in host-microbial interactions as well as animal physiology, behaviour and
402 ecology.

403

404 Acknowledgements

405 ML receives support from the CNRS, the French Research Agency (ANR 3DNaviBee: ANR-
406 19-CE37-0024), the European Regional Development Fund (FEDER ECONECT:
407 MP0021763), and the European Research Council (ERC-CoG BEE-MOVE: GA101002644).

408

409 Data accessibility

410 Kutz et al. data is available here: doi.org/10.26180/5cfe1ddaaafac. Lee et al. dataset is
411 available in Dryad: doi:10.5061/dryad.tp7519s. R script with functions for the
412 implementation of the Nutrigonometry framework is available in the Supplementary
413 Materials.

414

415 References

416 Arganda, S., S. Bouchebti, S. Bazazi, S. Le Hesran, C. Puga, G. Latil, S. J. Simpson, et al.

417 2017. Parsing the life-shortening effects of dietary protein: effects of individual amino acids.

418 Proceedings of the Royal Society B: Biological Sciences 284:20162052.

419 Arien, Y., A. Dag, S. Zarchin, T. Masci, and S. Shafir. 2015. Omega-3 deficiency impairs

420 honey bee learning. Proceedings of the National Academy of Sciences of the United States of

421 America 112:15761-15766.
422 Barragan-Fonseca, K. B., M. Dicke, and J. J. A. van Loon. 2018. Influence of larval density
423 and dietary nutrient concentration on performance, body protein, and fat contents of black
424 soldier fly larvae (*Hermetia illucens*). Entomologia Experimentalis et Applicata 166:761-
425 770.

426 Barragan-Fonseca, K. B., G. Gort, M. Dicke, and J. J. A. van Loon. 2021. Nutritional
427 plasticity of the black soldier fly (*Hermetia illucens*) in response to artificial diets varying in
428 protein and carbohydrate concentrations. Journal of Insects as Food and Feed 7:51–61.

429 Behmer, S. T. 2009. Insect herbivore nutrient regulation. Annual Review of Entomology
430 54:165–187.

431 Bunning, H., J. Rapkin, L. Belcher, C. R. Archer, K. Jensen, and J. Hunt. 2015. Protein and
432 carbohydrate intake influence sperm number and fertility in male cockroaches, but not sperm
433 viability. Proceedings of the Royal Society B: Biological Sciences 282:20142144.

434 del Castillo, E., P. Chen, A. Meyers, J. Hunt, and J. Rapkin. 2020. Confidence regions for the
435 location of response surface optima: the R package OptimaRegion. Communications in
436 Statistics-Simulation and Computation 1–21.

437 del Castillo, E., J. Hunt, and J. Rapkin. 2016. OptimaRegion: confidence regions for Optima.
438 R package version 0.2.

439 Fanson, B. G., and P. W. Taylor. 2012. Protein:carbohydrate ratios explain life span patterns
440 found in Queensland fruit fly on diets varying in yeast:sugar ratios. Age (Dordr) 34:1361–
441 1368.

442 Fanson, B. G., S. Yap, and P. W. Taylor. 2012. Geometry of compensatory feeding and water
443 consumption in *Drosophila melanogaster*. Journal of Experimental Biology 215:766–773.

444 Felton, A. M., A. Felton, D. Raubenheimer, S. J. Simpson, W. J. Foley, J. T. Wood, I. R.
445 Wallis, et al. 2009. Protein content of diets dictates the daily energy intake of a free-ranging
446 primate. Behavioral Ecology. 20:685-690
447 Gage, M. J. G., and P. A. Cook. 1994. Sperm size or numbers - Effects of nutritional stress

448 upon eupyrene and apyrene sperm production strategies in the moth *Plodia-Interpunctella*

449 (Lepidoptera, Pyralidae). Functional Ecology 8:594–599.

450 Goodrich, B., J. Gabry, I. Ali, and S. Brilleman. 2020. rstanarm: Bayesian Applied

451 Regression Modeling via Stan. R Package v. 2.19. 2.

452 Gosby, A. K., A. D. Conigrave, D. Raubenheimer, and S. J. Simpson. 2014. Protein leverage

453 and energy intake. Obesity Reviews 15:183–191.

454 Grandison, R. C., M. D. W. Piper, and L. Partridge. 2009. Amino-acid imbalance explains

455 extension of lifespan by dietary restriction in *Drosophila*. Nature 462:1061–1064.

456 Guo, J., Y. Cui, P. Lin, B. Zhai, Z. Lu, J. W. Chapman, and G. Hu. 2021. Male nutritional

457 status does not impact the reproductive potential of female *Cnaphalocrocis medinalis* moths

458 under conditions of nutrient shortage. Insect Science. doi.org/10.1111/1744-7917.12939

459 Hewson-Hughes, A. K., V. L. Hewson-Hughes, A. Colyer, A. T. Miller, S. J. McGrane, S. R.

460 Hall, R. F. Butterwick, et al. 2013. Geometric analysis of macronutrient selection in breeds of

461 the domestic dog, Canis lupus familiaris. Behavioral Ecology 24:293–304.

462 Hewson-Hughes, A. K., V. L. Hewson-Hughes, A. T. Miller, S. R. Hall, S. J. Simpson, and

463 D. Raubenheimer. 2011. Geometric analysis of macronutrient selection in the adult domestic

464 cat, felis catus. Journal of Experimental Biology 214:1039–1041.

465 Hope, R. M., M. R. M. Hope, and R. Collate’CI. 2013. Package ‘Rmisc.’ group 101:2.

466 House, C. M., K. Jensen, J. Rapkin, S. Lane, K. Okada, D. J. Hosken, and J. Hunt. 2015.

467 Macronutrient balance mediates the growth of sexually selected weapons but not genitalia in

468 male broad□horned beetles. Functional Ecology. 30:769-779

469 Hunt, J., R. Brooks, M. D. Jennions, M. J. Smith, C. L. Bentsen, and L. F. Bussiere. 2004.

470 High-quality male field crickets invest heavily in sexual display but die young. Nature

471 432:1024–1027.
472 Jensen, K., C. McClure, N. K. Priest, and J. Hunt. 2015. Sex-specific effects of protein and
473 carbohydrate intake on reproduction but not lifespan in *Drosophila melanogaster*. *Aging Cell*
474 14:605-615

475 Kutz, T. C., C. M. Sgrò, and C. K. Mirth. 2019. Interacting with change: Diet mediates how
476 larvae respond to their thermal environment. *Functional Ecology* 33:1940–1951.

477 Lee, K. P., S. J. Simpson, F. J. Clissold, R. Brooks, J. W. Ballard, P. W. Taylor, N. Soran, et
478 al. 2008. Lifespan and reproduction in *Drosophila*: New insights from nutritional geometry.

479 Proceedings of the National Academy of Sciences of the United States of America 105:2498–2503.
480

481 Lihoreau, M., J. Buhl, M. A. Charleston, G. A. Sword, D. Raubenheimer, and S. J. Simpson.
482 2014. Modelling nutrition across organizational levels: from individuals to superorganisms.
483 Journal of Insect Physiology 69:2–11.

484 Ma, C., C. K. Mirth, M. D. Hall, and M. D. W. Piper. 2020. Amino acid quality modifies the
485 quantitative availability of protein for reproduction in *Drosophila melanogaster*. *Journal of*
486 insect physiology 104050.

487 Maklakov, A. A., S. J. Simpson, F. Zajitschek, M. D. Hall, J. Dessmann, F. Clissold, D.

488 Raubenheimer, et al. 2008. Sex-specific fitness effects of nutrient intake on reproduction and
489 lifespan. *Current Biology* 18:1062–1066.

490 McDonald, J. M. C., P. Nabili, L. Thorsen, S. Jeon, and A. W. Shingleton. 2021. Sex-specific
491 plasticity and the nutritional geometry of insulin-signaling gene expression in *Drosophila*
492 *melanogaster*. *EvoDevo* 12:1–17.

493 Milman, V. 1998. Surprising geometric phenomena in high-dimensional convexity theory.
494 Pages 73–91 in *European Congress of Mathematics*. Springer.

495 Morimoto, J., and M. Lihoreau. 2019. Quantifying nutritional trade-offs across
496 multidimensional performance landscapes. *The American Naturalist* 193:E168–E181.
497 ————. 2020. Open data for open questions in comparative nutrition. Insects 11:236.

498 Morimoto, J., A. Senior, K. Ruiz, J. A. Wali, T. Pulpitel, S. M. Solon-Biet, V. C. Cogger, et

499 al. 2019. Sucrose and starch intake contribute to reduced alveolar bone height in a rodent
500 model of naturally occurring periodontitis. PLoS ONE 14.

501 Morimoto, J., and S. Wigby. 2016. Differential effects of male nutrient balance on pre-and
502 post-copulatory traits, and consequences for female reproduction in *Drosophila
503 melanogaster*. Scientific Reports 6.

504 Ng, S. H., S. J. Simpson, and L. W. Simmons. 2018. Macronutrients and micronutrients drive
505 trade-offs between male pre- and postmating sexual traits. Functional Ecology 32:2380–
506 2394.

507 Ng, S. H., M. Stat, M. Bunce, S. J. Simpson, and L. W. Simmons. 2019. Protein and
508 carbohydrate intakes alter gut microbial community structure in crickets: a Geometric
509 Framework approach. FEMS Microbiology Ecology 95.

510 Nychka, D., F. Reinhard, J. Paige, and S. Sain. 2017. fields: Tools for spatial data. R package
511 9.9.

512 Piper, M. D. W., G. A. Soultoukis, E. Blanc, A. Mesaros, S. L. Herbert, P. Juricic, X. He, et
513 al. 2017. Matching dietary amino acid balance to the in silico-translated exome optimizes
514 growth and reproduction without cost to lifespan. Cell metabolism 25:610–621.

515 Polak, M., L. W. Simmons, J. B. Benoit, K. Ruohonen, S. J. Simpson, and S. M. Solon-Biet.

516 2017. Nutritional geometry of paternal effects on embryo mortality. Proceedings of the Royal
517 Society B: Biological Sciences 284:20171492.

518 Ponton, F., K. Wilson, S. C. Cotter, D. Raubenheimer, and S. J. Simpson. 2011. Nutritional
519 Immunology: A Multi-Dimensional Approach. PLoS Pathogens 7:e1002223.

520 Ponton, F., K. Wilson, A. Holmes, D. Raubenheimer, K. L. Robinson, and S. J. Simpson.

521 2015. Macronutrients mediate the functional relationship between Drosophila and Wolbachia.
522 Proceedings of the Royal Society B-Biological Sciences 282:20142029.

523 Post, S., and M. Tatar. 2016. Nutritional geometric profiles of insulin/IGF expression in

524 Drosophila melanogaster. PloS one 11:e0155628.

525 R Core Team. 2019. R: A language and environment for statistical computing. R Foundation

526 for Statistical Computing.

527 Rabinovich, J. E. 2021. Morphology, life cycle, environmental factors and fitness-a machine

528 learning analysis in kissing bugs (Hemiptera, Reduviidae, Triatominae). Frontiers in Ecology

529 and Evolution 9:88.

530 Rapkin, J., K. Jensen, C. R. Archer, C. M. House, S. K. Sakaluk, E. Del Castillo, and J. Hunt.

531 2018. The geometry of nutrient space-based life-history trade-offs: sex-specific effects of

532 macronutrient intake on the trade-off between encapsulation ability and reproductive effort in

533 decorated crickets. The American Naturalist 191:452–474.

534 Raubenheimer, D., and S. Simpson. 2020. Eat Like the Animals: What Nature Teaches Us

535 about the Science of Healthy Eating. Houghton Mifflin.

536 Reddiex, A. J., T. P. Gosden, R. Bonduriansky, and S. F. Chenoweth. 2013. Sex-specific

537 fitness consequences of nutrient intake and the evolvability of diet preferences. The

538 American Naturalist 182:91–102.

539 Roff, D. A. 2002. Life history evolution (Vol. 7). Sinauer Associates Sunderland.

540 Schwenke, R. A., B. P. Lazzaro, and M. F. Wolfner. 2016. Reproduction–Immunity Trade-

541 Offs in Insects. Annual Review of Entomology 61:239–256.

542 Simpson, S. J., F. J. Clissold, M. Lihoreau, F. Ponton, S. M. Wilder, and D. Raubenheimer.

543 2015. Recent advances in the integrative nutrition of Arthropods. Annual Review of

544 Entomology 60:293–311.

545 Simpson, S. J., D. G. Le Couteur, D. E. James, J. George, J. E. Gunton, S. M. Solon-Biet, and

546 D. Raubenheimer. 2017. The Geometric Framework for Nutrition as a tool in precision
547 medicine. Nutrition and Healthy Aging 4:217-226.

548 Simpson, S. J., and D. Raubenheimer. 1993a. A multi-level analysis of feeding behaviour:

549 the geometry of nutritional decisions. Philosophical Transactions of the Royal Society B-

550 Biological Sciences 342:381-402.

551 Simpson, S. J., and D. Raubenheimer. 1993b. A multi-level analysis of feeding behaviour:

552 The geometry of nutritional decisions. Philosophical Transactions of the Royal Society B:

553 Biological Sciences 342:381-402.

554 Simpson, S. J., and D. Raubenheimer. 2012. The Nature of Nutrition: A Unifying Framework

555 From Animal Adaptation to Human Obesity (1st ed.). Princeton university press, Princeton,

556 New Jersey.

557 Simpson, S. J., G. A. Sword, P. D. Lorch, and I. D. Couzin. 2006. Cannibal crickets on a

558 forced march for protein and salt. Proceedings of the National Academy of Sciences of the

559 United States of America 103:4152-4156.

560 Solon-Biet, S. M., A. C. McMahon, J. W. O. Ballard, K. Ruohonen, L. E. Wu, V. C. Cogger,

561 A. Warren, et al. 2014. The ratio of macronutrients, not caloric intake, dictates

562 cardiometabolic health, aging, and longevity in ad libitum-fed mice. Cell Metabolism

563 19:418-430.

564 Stearns, S. C. 1992. The evolution of life histories (Vol. 249). Oxford University Press

565 Oxford.

566 Treidel, L. A., R. M. Clark, M. T. Lopez, and C. M. Williams. 2021. Physiological demands

567 and nutrient intake modulate a trade-off between dispersal and reproduction based on age and

568 sex of field crickets. Journal of Experimental Biology 224:jeb237834.

569 Wadhwa, R. R., D. F. K. Williamson, A. Dhawan, and J. G. Scott. 2018. TDAstats: R

570 pipeline for computing persistent homology in topological data analysis. Journal of Open

571 Source Software 3:860.
572 Watanabe, J. 2021. Detecting (non)parallel evolution in multidimensional spaces: angles,

573 correlations, and eigenanalysis. EcoEvoRxiv 1:25.

574 Weinberger, S. 2011. What is... persistent homology? Notices of the AMS 58:36–39.

575 Wickham, H. 2016. ggplot2: elegant graphics for data analysis. Springer.

576 Wickham, H., M. Averick, J. Bryan, W. Chang, L. D. McGowan, R. François, G. Grolemund,

577 et al. 2019. Welcome to the Tidyverse. Journal of Open Source Software 4:1686.

578 Wood, S., and M. S. Wood. 2015. Package ‘mgcv.’ R package version 1:29.

579 Zomorodian, A., and G. Carlsson. 2005. Computing Persistent Homology. Discrete &

580 Computational Geometry 33:249–274.

581

582
583 Table caption

584

585

586 Table 1. Nutrigonometry quantification of nutritional trade-offs between lifespan and reproduction.

587 Estimates of $\theta_{i,j}$ (in degrees) and $h_{i,j}$ (in mg) for the nutritional trade-off between lifespan and reproductive rate. Analysis from the data presented in Lee et al. (2008).

588 between lifespan and reproductive rate. Analysis from the data presented in Lee et al. (2008).

589 Confidence intervals overlapping zero implies no difference in the peaks. Magnitude of the estimates indicate the strength of nutritional trade-offs (i.e., larger magnitudes indicate stronger nutritional trade-offs). Note that $\theta_{i,j}$ is bound between 0 and 90 degrees (i.e., 0 and $\pi/2$).

590

591 stronger nutritional trade-offs). Note that $\theta_{i,j}$ is bound between 0 and 90 degrees (i.e., 0 and $\pi/2$).

592 $\pi/2$).

593

594

595 Table 2. Nutrigonometry estimates of nutritional compromises.

596 intake that maximises lifespan and reproductive rate based on the predicted peak region. Comparison made with the visual peak ratio from Lee et al. (2008). Note that all models show that the estimated peak ratio between traits do not overlap and thus, corroborate the inference of a nutritional trade-off between traits, leading to a nutritional compromise. Note also that all but one model (i.e., GAM smooth for fixed ratio reproductive rate data) predicted peak region ~1:4, which is the ratio that individuals balance when given the ability to balance their diet ('choice'). All other models suggest that a P:C ratio of 1:4 is lower than the ratio needed to maximise lifespan but higher than that for reproductive rate, further supporting the concept of a nutritional compromise.

597

598 Comparison made with the visual peak ratio from Lee et al. (2008). Note that all models show that the estimated peak ratio between traits do not overlap and thus, corroborate the inference of a nutritional trade-off between traits, leading to a nutritional compromise. Note also that all but one model (i.e., GAM smooth for fixed ratio reproductive rate data) predicted peak region ~1:4, which is the ratio that individuals balance when given the ability to balance their diet ('choice'). All other models suggest that a P:C ratio of 1:4 is lower than the ratio needed to maximise lifespan but higher than that for reproductive rate, further supporting the concept of a nutritional compromise.

599

600 also that all but one model (i.e., GAM smooth for fixed ratio reproductive rate data) predicted peak region ~1:4, which is the ratio that individuals balance when given the ability to balance their diet ('choice'). All other models suggest that a P:C ratio of 1:4 is lower than the ratio needed to maximise lifespan but higher than that for reproductive rate, further supporting the concept of a nutritional compromise.

601

602 their diet ('choice'). All other models suggest that a P:C ratio of 1:4 is lower than the ratio needed to maximise lifespan but higher than that for reproductive rate, further supporting the concept of a nutritional compromise.

603

604 concept of a nutritional compromise.

605

606

607

608

609

610
611 **Figure caption**

<figure><img src="image_2.png" /></figure>

<figure><img src="image_3.png" /></figure>

<figure><img src="image_4.png" /></figure>

612 **Figure 1. Nutrigonometry framework.** (a) Considering an infinite number of nutritional rails that divide the nutritional space into right-angle triangles, the angle $\alpha_i$ and the hypothenuse can be calculated from trigonometric relationships. (b) Nutrigonometry applied to compare two traits is simple as it allows for the estimates of the strength of nutritional trade-offs in terms of nutrient balance (angle $\alpha_i$) and nutrient concentration (the difference $\alpha_j$ given in absolute terms). (c) Plausible scenarios for the estimates of $\alpha_i$ and $\alpha_j$. (d) Metrics used to the peak prediction in the 3D landscape. RMSE was calculated as root-mean-square difference between the predicted and observed values of the trait (z-axis) in the peak region. Nutrient spread (both carbohydrate and protein) was calculated as the standard deviation of the predicted peak region. The area of the polygon that encapsulates the predicted peak region was also estimated as a proxy of prediction performance. Lastly, the topology of the predicted datapoints for the peak region was analysed using the concept of persistence homology (see Methods) to identify homogeneity in predicted point structure.

625
626
627
628
629
630
631
632
<figure><img src="image_5.png" /></figure>

<caption>**Figure 2. Nutrigonometry framework to predict peak region in lifespan and reproductive rate landscape with different data structure.** (a) Lifespan landscapes with individual intake (top left panel) and fixed ratio (top right panel) from Lee et al. (2008) with the overlaid predicted peak regions. (b) Reproductive rate landscapes with individual intake (bottom left panel) and fixed ratio (bottom right panel) from Lee et al. (2008) with the overlaid predicted peak regions. For the landscapes, red represents peaks while light green represents valleys. For the predicted region, dark blue represents points with lower predicted z-values whereas bright yellow represents points with higher predicted z-values. The shaded polygon was added to facilitate visualisation of the predicted peak region and the homogeneity of points within the predicted peak.</caption>
<figure><img src="image_6.png" /><figcaption>Figure 3. Persistence Homology (PH) to investigate topological structure of the predicted peak region using Nutrigonometry. (a) PH plots for the topological analysis of the predicted peak region in lifespan of data containing the structure of individual intake (top left) and fixed intake data (top right). (b) PH plots for the topological analysis of the predicted peak region in reproductive rate with data of structure containing individual intake (bottom left) and fixed intake data (bottom right). Homogenous predicted peaks have red (dimension 0) and blue (dimension 1) points that are closer, as opposed to more heterogeneous predicted peaks upon which (some) points can be farther from each other. Note the different scales upon which the data is plotted (needed to aid visualisation of point clouds).</figcaption></figure>

657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
a.

<figure><img src="image_7.png" /></figure>

Intake

<figure><img src="image_8.png" /></figure>

b.

<figure><img src="image_9.png" /></figure>

Fixed ratio

<figure><img src="image_10.png" /></figure>

**Figure 4.** RMSE and peak area estimates in the Nutrigonometry peak region predictions. (a) RMSE and predicted peak area (i.e., area of the shaded polygon from the predicted region for lifespan and reproductive rate data), with structure containing individual intakes. (b) RMSE and predicted peak area (i.e., area of the shaded polygon from the predicted region for lifespan and reproductive rate data), with structure containing fixed ratios. Note that models with high RMSE can still be the best predictors of peak region.
697

698

699

700

701

702

703

704

705

706

707

708

709

710

711

712

713

714

715

716

717

718

719

720

721

722

723

724

725

726

727

728

729

730

731

732

733

734

735

736

735

736
<table><caption>**Table 1. Nutrigonometry quantification of nutritional trade-offs between lifespan and reproduction.** Estimates of $\theta_{i,j}$ (in degrees) and $h_{i,j}$ (in mg) for the nutritional trade-off between lifespan and reproductive rate. Analysis from the data presented in Lee et al. (2008). Confidence intervals overlapping zero implies no difference in the peaks. Magnitude of the estimates indicate the strength of nutritional trade-offs (i.e., larger magnitudes indicate stronger nutritional trade-offs). Note that $\theta_{i,j}$ is bound between 0 and 90 degrees (i.e., 0 and $\frac{\pi}{2}$).</caption><thead><tr><th>Parameter</th><th>Model</th><th>Estimate</th><th>Std</th><th>LwrCI</th><th>UprCI</th></tr></thead><tbody><tr><td rowspan="10">Trade-off (intakes)</td><td rowspan="7">θ<sub>i,j</sub></td><td>SVM</td><td>14.456</td><td>10.728</td><td>-6.574</td><td>35.485</td></tr><tr><td>RF</td><td>14.508</td><td>8.109</td><td>-1.388</td><td>30.404</td></tr><tr><td>GAM par</td><td>16.128</td><td>4.984</td><td>6.358</td><td>25.897</td></tr><tr><td>GAM par</td><td>16.166</td><td>4.962</td><td>6.438</td><td>25.893</td></tr><tr><td>GBoost</td><td>17.063</td><td>9.575</td><td>-1.706</td><td>35.831</td></tr><tr><td>LM</td><td>17.940</td><td>4.826</td><td>8.479</td><td>27.400</td></tr><tr><td>Bayes</td><td>18.205</td><td>4.709</td><td>8.974</td><td>27.436</td></tr><tr><td rowspan="6">h<sub>i,j</sub></td><td>KNN</td><td>21.203</td><td>6.181</td><td>9.088</td><td>33.318</td></tr><tr><td>SVM</td><td>16.792</td><td>65.723</td><td>-112.038</td><td>145.622</td></tr><tr><td>KNN</td><td>50.015</td><td>48.137</td><td>-44.343</td><td>144.373</td></tr><tr><td>GBoost</td><td>52.851</td><td>75.218</td><td>-94.591</td><td>200.293</td></tr><tr><td>RF</td><td>58.561</td><td>66.066</td><td>-70.943</td><td>188.064</td></tr><tr><td>LM</td><td>75.870</td><td>35.142</td><td>6.984</td><td>144.757</td></tr><tr><td rowspan="10">Trade-off (fixed)</td><td rowspan="7">θ<sub>i,j</sub></td><td>Bayes</td><td>76.729</td><td>34.444</td><td>9.211</td><td>144.247</td></tr><tr><td>GAM par</td><td>120.245</td><td>29.406</td><td>62.604</td><td>177.886</td></tr><tr><td>GAM par</td><td>124.533</td><td>27.930</td><td>69.784</td><td>179.282</td></tr><tr><td>GAM par</td><td>9.645</td><td>5.897</td><td>-1.916</td><td>21.205</td></tr><tr><td>SVM</td><td>11.840</td><td>5.649</td><td>0.767</td><td>22.913</td></tr><tr><td>RF</td><td>17.368</td><td>5.848</td><td>5.906</td><td>28.831</td></tr><tr><td>GBoost</td><td>20.177</td><td>5.057</td><td>10.264</td><td>30.090</td></tr><tr><td rowspan="6">h<sub>i,j</sub></td><td>GAM par</td><td>21.177</td><td>3.872</td><td>13.588</td><td>28.766</td></tr><tr><td>Bayes</td><td>26.454</td><td>5.876</td><td>14.935</td><td>37.973</td></tr><tr><td>LM</td><td>26.499</td><td>5.903</td><td>14.928</td><td>38.070</td></tr><tr><td>KNN</td><td>31.428</td><td>7.186</td><td>17.342</td><td>45.513</td></tr><tr><td>SVM</td><td>2.381</td><td>68.888</td><td>-132.653</td><td>137.416</td></tr><tr><td>RF</td><td>4.819</td><td>64.841</td><td>-122.283</td><td>131.921</td></tr><tr><td>GBoost</td><td>9.377</td><td>65.605</td><td>-119.222</td><td>137.975</td></tr><tr><td rowspan="6">h<sub>i,j</sub></td><td>Bayes</td><td>41.461</td><td>34.912</td><td>-26.974</td><td>109.896</td></tr><tr><td>LM</td><td>42.305</td><td>34.429</td><td>-25.182</td><td>109.791</td></tr><tr><td>GAM par</td><td>46.635</td><td>40.358</td><td>-32.475</td><td>125.745</td></tr><tr><td>GAM par</td><td>49.009</td><td>32.855</td><td>-15.394</td><td>113.412</td></tr><tr><td>KNN</td><td>82.516</td><td>30.388</td><td>22.949</td><td>142.083</td></tr></tbody></table>
<table><caption>**Table 2. Nutrigonometry estimates of nutritional compromises.** Estimates of optimal intake that maximises lifespan and reproductive rate based on the predicted peak region. Comparison made with the visual peak ratio from Lee et al. (2008). Note that all models show that the estimated peak ratio between traits do not overlap and thus, corroborate the inference of a nutritional trade-off between traits, leading to a nutritional compromise. Note also that all but one model (i.e., GAM smooth for fixed ratio reproductive rate data) predicted peak region ~1:4, which is the ratio that individuals balance when given the ability to balance their diet ('choice'). All other models suggest that a P:C ratio of 1:4 is lower than the ratio needed to maximise lifespan but higher than that for reproductive rate, further supporting the concept of a nutritional compromise.</caption><thead><tr><th>Data</th><th>Trait</th><th>Model</th><th>Mean</th><th>Upr CI</th><th>Lwr CI</th><th>Target (Visual)</th></tr></thead><tbody><tr><td rowspan="10">Peak Ratio (intakes)</td><td rowspan="7">Lifespan</td><td>GBoost</td><td>5.235</td><td>5.205</td><td>5.265</td><td rowspan="7">16</td></tr><tr><td>RF</td><td>5.533</td><td>5.508</td><td>5.557</td></tr><tr><td>SVM</td><td>5.864</td><td>5.836</td><td>5.892</td></tr><tr><td>LM</td><td>9.084</td><td>9.048</td><td>9.120</td></tr><tr><td>Bayes</td><td>9.154</td><td>9.118</td><td>9.190</td></tr><tr><td>KNN</td><td>12.075</td><td>12.015</td><td>12.135</td></tr><tr><td>GAM.smooth</td><td>13.055</td><td>12.997</td><td>13.114</td></tr><tr><td>GAMaplus</td><td>13.108</td><td>13.049</td><td>13.168</td></tr><tr><td rowspan="7">Reproductive rate</td><td>GBoost</td><td>1.858</td><td>1.853</td><td>1.864</td><td rowspan="7">2</td></tr><tr><td>KNN</td><td>2.041</td><td>2.037</td><td>2.045</td></tr><tr><td>RF</td><td>2.138</td><td>2.133</td><td>2.144</td></tr><tr><td>SVM</td><td>2.147</td><td>2.138</td><td>2.156</td></tr><tr><td>Bayes</td><td>2.194</td><td>2.191</td><td>2.197</td></tr><tr><td>LM</td><td>2.215</td><td>2.212</td><td>2.219</td></tr><tr><td>GAM.smooth</td><td>2.644</td><td>2.639</td><td>2.650</td></tr><tr><td>GAMaplus</td><td>2.661</td><td>2.656</td><td>2.667</td></tr><tr><td rowspan="10">Peak Ratio (fixed)</td><td rowspan="7">Lifespan</td><td>GBoost</td><td>13.078</td><td>12.987</td><td>13.170</td><td rowspan="7">16</td></tr><tr><td>SVM</td><td>14.946</td><td>14.873</td><td>15.019</td></tr><tr><td>RF</td><td>15.107</td><td>15.045</td><td>15.169</td></tr><tr><td>GAM.smooth</td><td>16.977</td><td>16.859</td><td>17.097</td></tr><tr><td>GAMaplus</td><td>20.623</td><td>20.536</td><td>20.710</td></tr><tr><td>KNN</td><td>26.050</td><td>25.929</td><td>26.173</td></tr><tr><td>Bayes</td><td>32.426</td><td>32.237</td><td>32.617</td></tr><tr><td>LM</td><td>32.933</td><td>32.744</td><td>33.125</td></tr><tr><td rowspan="7">Reproductive rate</td><td>KNN</td><td>1.467</td><td>1.463</td><td>1.470</td><td rowspan="7">2</td></tr><tr><td>LM</td><td>1.836</td><td>1.832</td><td>1.839</td></tr><tr><td>Bayes</td><td>1.841</td><td>1.837</td><td>1.845</td></tr><tr><td>GBoost</td><td>2.171</td><td>2.168</td><td>2.174</td></tr><tr><td>GAMaplus</td><td>2.244</td><td>2.241</td><td>2.248</td></tr><tr><td>RF</td><td>2.545</td><td>2.539</td><td>2.552</td></tr><tr><td>SVM</td><td>3.527</td><td>3.516</td><td>3.538</td></tr><tr><td>GAM.smooth</td><td>4.280</td><td>4.265</td><td>4.296</td></tr></tbody></table>