A Parent-Offspring Trade-Off Limits the Evolution of an Ontogenetic Niche Shift

Many free-living animal species, including the majority of fish, insects, and amphibians, change their food and habitat during their life. Even though these ontogenetic changes in niche are common, it is not well understood which ecological conditions have favored the evolution of these shifts. Using an adaptive dynamics approach, we show that it is evolutionarily advantageous to switch to an alternative food source in the course of ontogeny when this results in a higher intake rate for the switching consumers. Individuals are, however, not able to specialize on this new food source when this negatively affects the performance early in life on the original food source. Selection on these early life stages is so strong that in species with a complete diet shift, evolution results in large juveniles and adults that are maladapted to the alternative food source while their offspring are specialized on the original food source when young. These outcomes suggest strong selection to decouple the different life stages, such that they can maximize their performance on different food sources independently from each other. Metamorphosis could be a way to decouple the different life stages and therefore evolve in species that feed on multiple food sources during their life.


Introduction
Almost all free-living animal species change their niche during their life. The best-known examples are species with a metamorphosis, such as frogs and butterflies, that change not only their diet and habitat but also their complete morphology over their lifetime. Less well-known examples of species changing their niche include fish (e.g., many piscivorous fish feed on zooplankton when small; Mittelbach and Persson 1998), reptiles (e.g., lizards are often carnivorous early in life but switch to herbivory later; Werner and Gilliam 1984), and invertebrates (e.g., spiders include larger food items in their diet when they grow larger ;Turner 1979). These so-called ontogenetic niche shifts are the rule rather than the exception in the animal world (Werner and Gilliam 1984).
A common explanation for the evolution of ontogenetic niche shifts is that shifting niches is a way to maximize somatic growth rate at each size (Werner and Gilliam 1984;Werner 1988). Larger individuals often gain access to food sources and habitats that they cannot use when small. Furthermore, growth of an individual will change its energy requirements and also its feeding efficiency on different food sources (Werner and Gilliam 1984). Therefore, the profitability of a given prey type generally changes with increasing body size. By changing niches, species can optimize growth rates across the life cycle. Werner and Gilliam (1984) have shown that the population growth rate is maximized when individuals shift between niches in such a way that the ratio of mortality to growth is minimized at each size. However, this explanation for the evolution of ontogenetic niche shifts is based on individual-level optimization and does not take into account the feedback between an individual and its environment (other individuals of the population, food densities, etc.). Changing niches over ontogeny will affect food densities and thereby the profitability of the different diets. This change in food densities will in turn change the optimal strategy of an individual. Therefore, when studying the evolution of ontogenetic niche shifts one should take into account the feedback between the environment, in particular food densities, and the different strategies of individuals. Although the optimal timing for ontogenetic niche shifts has been investigated in such a context (Claessen and Dieckmann 2002), it is not well understood which ecological conditions have favored the evolution of ontogenetic niche shifts in the first place. The aim of this article is to gain insight into how ontogenetic niche shifts can evolve, tak-ing into account the feedback between the environment and the individuals.
In this study we investigate which food conditions promote the evolution of an ontogenetic niche shift in species where large individuals have access to an alternative food source, assuming that there is a trade-off between early and late foraging success. Different food sources often require different morphologies to be effectively utilized (Werner 1977;Hjelm et al. 2000). Hence, species that change their food source use over their lifetime experience different selection pressures on their morphologies in different phases of their life. Whereas some species (e.g., many frog species) undergo sharp and abrupt metamorphoses to accommodate such ontogenetic changes in selection pressure, other species (e.g., the banded watersnake Nerodia fasciata; Vincent et al. 2007) cope with ontogenetic niche shifts only through allometric changes in body form to modify feeding morphology and thereby their efficiency on different food sources. There are, however, limits to the extent that allometric growth can change the morphology of an organism. Changing diet during ontogeny can therefore lead to a trade-off between early and late foraging success, since specialization on one food source comes at the expense of specialization on the other (Werner and Gilliam 1984). Of course, it would be advantageous for a species with an ontogenetic niche shift to be able to specialize independently on the different food sources to get rid of the trade-off between early and late foraging success. However, life stages often cannot evolve independently from each other because of genetic correlations between the stages (Schluter et al. 1991). Perch (Perca fluviatilis), for example, switch from pelagic zooplankton to benthic macroinvertebrates and ultimately other fish over their ontogeny (Persson 1988). It has been hypothesized that perch are susceptible to morphological trade-offs, which will reduce efficiency in each of these niches, compared to a species that specializes in only one niche (Persson 1988;Bergman and Greenberg 1994). Hjelm et al. (2000) indeed showed that such a trade-off in body morphology between the benthic and piscivorous niches exists.
In this study we assume that there is an original food source available for all individuals and an alternative food source that, because of size constraints, is available only for large juveniles and adults but not for small juveniles, as, for example, occurs in many fish species that start life as planktivores but become piscivores when they have reached a size advantage over their potential prey (Mittelbach and Persson 1998). We further assume that the two food sources occur either in the same habitat or in two nonoverlapping habitats. When they occur in the same habitat (e.g., plankton and prey fish in a pelagic environment), there is only selection on the foraging skills (attack rates) of the consumers on the two food sources. On the other hand, when the food sources occur in two nonoverlapping habitats (e.g., the pelagic and benthic parts of a lake), there is, in addition to selection on these foraging skills, selection for the food/habitat preference. For the purpose of this study we define the ontogenetic niche as the combination of this food/habitat preference and the foraging skills of the consumer. First, we investigate for which food source productivities individuals specialize to an alternative food source when it occurs in the same habitat as the original food source. Second, we study how both the food source use and the specialization on the different food sources evolve when they occur in two nonoverlapping habitats. To take into account how ecological interactions can affect evolution, we use the framework of adaptive dynamics. Adaptive dynamics provides the fundamental tools to study evolution in an ecological context (Dieckmann and Law 1996;Geritz et al. 1998) and is therefore an appropriate framework to study the evolution of ontogenetic niche shifts in the context of possible population feedback on food sources.

Population Dynamics
We model the population dynamics of a consumer population feeding on two food sources, using the stagestructured biomass approach as developed in de . Such a stage-structured biomass model captures the dynamics of a continuous size distribution, ranging between the size at birth of neonate individuals and the (fixed) size of the nongrowing adult individuals, while keeping track of the changes in biomass only in one or more juvenile body-size classes and the class of nongrowing adult individuals. In contrast to the original formulation of this stagestructured biomass framework, however, we analyze a simplified version in which possible starvation conditions of consumers are ignored, as on an ecological timescale the consumer-resource model always approaches a stable equilibrium that precludes individual starvation. Since ontogenetic niche shifts generally occur between the larval and juvenile stages, before sexual maturation (e.g., in fish, amphibians, marine invertebrates, and the ancestor of holometabolous insects; Sehnal et al. 1996), we divide the juvenile stage into two classes, small juveniles (S) and large juveniles (L). It is assumed that the population feeds on two food sources that possibly occur in two distinct habitats. One of the food sources, the original food source (X 1 ), is available for all individuals, while the other food source, the alternative food source (X 2 ), is available only for large juvenile and adult (A) consumers. When the two food sources occur in the same habitat, the consumer experiences the food sources as intermixed in space and can feed on both food sources simultaneously. When the two food sources occur in two nonoverlapping habitats, individuals have to choose which food source to feed on. In this case there is, for large individuals, a trade-off between foraging on X 1 and foraging on X 2 that is absent when the food sources occur in the same habitat. To capture these differences in feeding behavior, we use the following spatially implicit multispecies mass-specific functional response (Mc-Cann et al. 2005) for large juveniles and adults foraging in two habitats of the same size: where In this equation, b is the amount of spatial overlap of the two food source habitats, f is the relative preference for the original food source, and a 1 and a 2 are the mass-specific attack rates on the original and alternative food source, respectively. When b p 1, the two food source habitats overlap completely and the two food sources are intermixed in space. In this case, the preference parameter f is obsolete and selection acts only on the attack rates a 1 and a 2 . Alternatively, when b p 0, the two food sources occur in two nonoverlapping habitats, and individuals need to choose which food source to forage on. The parameters f 1 and f 2 determine the fraction of time large individuals search for the original and the alternative food source, respectively. The following set of differential equations describes the ecological dynamics of the biomass densities of the consumer and the food sources: Default parameter values of the model are listed in table 1. The food sources follow semichemostat dynamics with a turnover rate of d and will reach equilibrium densities of X 1, max and X 2, max , respectively, in the absence of the consumer population. The consumers feed according to a type 2 functional response on the food sources. The stage-structured biomass approach is based on the assumption that the rates of food intake and maintenance are linearly related to the body size of individual consumers. Since feeding efficiencies often change over ontogeny (Werner 1988), we include the factor q to modulate the attack rate of the smallest individuals. When q p 1, all stages have the same mass-specific attack rate on the original food source. For values of q larger (smaller) than 1, the smallest individuals are more (less) efficient in feeding on the original food source than larger- sized individuals. Ingested food is assimilated with efficiency j and first used to cover maintenance costs. All individuals have a mass-specific maintenance rate of T per unit biomass. The difference between mass-specific food intake and maintenance costs determines the mass-specific net biomass production of individuals: Juveniles invest all their net biomass production in growth in body size, while adults convert all their net biomass production into new offspring. It is assumed that adults do not grow anymore and have an identical size M A . We assume that small and large juveniles and adults experience constant background mortality rates of m S , m L , and m A , respectively. Juveniles mature into the next stage (large juveniles or adults) after reaching a certain size. Offspring are born at a size M A z 1 z 2 . The parameters z 1 and z 2 represent the ratio between the smallest and largest sizes of individuals within the small-juvenile and large-juvenile stages, respectively. The mass-specific maturation functions depend on the net biomass production, the mortality rate, and the size range (z 1 or z 2 ) over which an individual grows in a certain stage. The form of the maturation functions has been derived from an underlying, fully size-structured population model to ensure the exact identity between all equilibrium states in the stage-structured biomass model and its fully size-structured analog (see de Roos et al. 2008 for details). The mass-specific maturation functions for small and large juveniles, respectively, are given by Note that starvation conditions are ignored, which implies that n S (X 1 ), n L (X 1 , X 2 ), and n A (X 1 , X 2 ) are always positive and therefore that g S (n S , m S ) and g L (n L , m L ) are as well.

Evolutionary Traits
The niche of an individual is determined by the preference for a certain food source (determined by the parameter f) and how well the consumer is specialized on this food source (determined by the attack rates). We assume that specialization on one food source comes at the expense of specialization on the other, leading to a trade-off between early and late foraging success. This means that small juveniles that are specialized on the original food source have a low efficiency on the alternative food source as adults and, vice versa, that adults that are highly specialized on the alternative food source produce offspring that perform badly on the original food source. To incorporate this in the model, we adopt a simple linear trade-off between the two mass-specific attack rates a 1 and a 2 , which is given by In these equations w is the relative specialization on the original food source and A max is the maximum value the attack rates can have. A value of w p 1 means that individuals are completely specialized in feeding on the original food source. In this case individuals cannot feed on the alternative food source at all. For low values of w, individuals are very efficient in feeding on the alternative food source and not very efficient in feeding on the original food source. Note that w can never have a value of 0 because in that case individuals cannot feed on the original food source at all, since a 1 p 0. The smallest individuals depend on this food source for their growth and therefore need to be able to feed on this. The relative preference for a certain food source is determined by the parameter f. A value of f p 1 means that large individuals have a strong preference for (the habitat with) the original food source. Vice versa, a value of f p 0 means that large individuals have a strong preference for (the habitat with) the alternative food source. When the food sources occur in the same habitat (b p 0), large individuals experience both food sources as completely intermixed in space and therefore forage on both food sources. In this case, the parameter f drops out of the model formulation, and evolutionary considerations of the food preference of large individuals are irrelevant.
When the two food sources occur in two nonoverlapping habitats (b p 1), both f and w evolve. Parameter w is a morphological trait that affects the foraging skills of an individual for its whole lifetime. Parameter f, however, is more a behavioral trait that determines the food source preference of an individual. This trait affects large juveniles and adults but not small juveniles, since they can feed only on the original food source. Therefore, the parameter f determines a trade-off only for large individuals between feeding on the original and feeding on the alternative food source, while parameter w represents a trade-off between early and late foraging success.

Evolutionary Analysis
For the evolutionary analysis the framework of adaptive dynamics is used (Dieckmann and Law 1996;Geritz et al. 1998). Adaptive dynamics is based on the assumptions that individuals reproduce asexually, that the population is completely monomorphic, and that small mutations occur randomly. These mutations occur infrequently, such that the mutant trait either spreads or dies out and the population has reached its ecological attractor before the next mutant arises. The ecological timescale is therefore considered much faster than the evolutionary timescale. The success of a mutant depends on its strategy and on the environment it encounters. In our model, the environment that a mutant experiences consists of the two food source densities, which are in equilibrium with the resident population and thus depend on the strategy of the resident ( X 1 (f, w) and X 2 (f, w)). The fitness of a mutant depends, therefore, not only on its own strategy but also indirectly on the strategy of the resident. From here onward we use, for simplicity, X 1 and X 2 to refer to the equilibrium densities of the food sources set by the strategy of the resident. The lifetime reproductive output, R 0 , can be used as a measure of invasion fitness (Mylius and Diekmann 1995). For the lifetime reproductive output of a mutant the notation R 0 ((f 0 , w 0 )j(f, w)) is used to indicate that it depends on both its own strategy (f 0 , w 0 ) and the strategy of the resident population (f, w) through its dependence on the food source densities that are set by the resident. A mutant can invade only if R 0 ((f 0 , w 0 )j(f, w)) 1 1. This new population can then subsequently be invaded by another mutant that has an invasion fitness that exceeds unity. In this way, the population experiences a succession of mutations and evolves in the direction of the selection gradient where y is the trait vector (f, w). The point where the selection gradient becomes 0 is the evolutionarily singular strategy (ESS), which can be evolutionary unstable or stable. In the latter case, no other mutant can invade in the population. If the singular strategy is evolutionary unstable, evolutionary branching can occur (Geritz et al. 1998). The lifetime reproductive output of an individual equals the probability of surviving until adulthood times the expected number of offspring produced over the lifetime of an adult. The survival probability until adulthood depends on the duration of the juvenile period and the mortality rate. Since juveniles mature into the next size class when reaching a certain size, the juvenile period depends on the growth rate and the size range over which a juvenile grows. The probability of surviving to the next size class can be shown to equal for small juveniles and for large juveniles (box 3.1 in de Roos and Persson 2013). All the net biomass production of adult individuals, which, given their size M A , equals M A n A (X 1 , X 2 ), is used for reproduction. Since offspring are born at a size M A z 1 z 2 , the reproduction rate (number of individuals per day) of a single adult equals n A (X 1 , X 2 )=z 1 z 2 . The average lifetime of an adult equals 1=m A . The lifetime reproduction of a mutant is then given by In this equation, the notations n S (X 1 , f 0 , w 0 ), n L (X 1 , X 2 , f 0 , w 0 ), and n A (X 1 , X 2 , f 0 , w 0 ) are used for the net biomass production of small juvenile, large juvenile, and adult mutants, respectively, in the environment set by the resident population.

Model Analysis
When the two food sources occur in the same habitat, only parameter w evolves. In this case, we calculate and classify all possible ESSs for different parameter combinations, using the PSPManalysis software package (de Roos 2016). This software numerically computes the (ecological) equilibrium of the model as a function of any parameter, using the computational approach described in Kirkilionis et al. (2001), Diekmann et al. (2003), and de Roos (2008). The basic idea behind this method is to solve for the equilibria of a physiologically structured population model by iteratively computing the resource densities for which the lifetime reproductive output of an individual equals 1. To compute the latter, the individual life history is computed by integration of a set of coupled ordinary differential equations that describe how the survival, fecundity, growth, and feeding of an individual changes over its lifetime. PSPManalysis automatically detects and classifies ESSs according to the classification of Geritz et al. (1998). The package can continue these singular points as a function of a second model parameter (see de Roos 2016 for details). The modelspecific file needed for PSPManalyis can be found in a zip file (available online), 1 together with an R script that executes all the calculations made in this article when only specialization w evolves.
To analyze the evolutionary dynamics when two traits evolve simultaneously, we use the canonical equation of adaptive dynamics to study to which attractor the system evolves. The canonical equation is a deterministic approximation of the evolutionary trajectory of traits, assuming infinitesimally small mutations (Dieckmann and Law 1996;Durinx et al. 2008); see appendix A (apps. A, B available online) for more details. We assume that, initially, all individuals forage on the original food source (f p 1) and are specialists on this food source as well (w p 0:9). A value of w p 0:9 means that large individuals are able to feed on the alternative food source but are not very efficient in doing so. We deliberately choose a value of w ! 1 to ensure that large individuals are able to feed on the alternative food source. A value of w p 1 means that large individuals cannot feed on the alternative food source at all, and in this case there is no selection pressure on w or f. We use PSPManalysis to simulate the evolutionary dynamics when both parameters evolve. In addition, we use a C-based simulation program to simulate the evolutionary dynamics in parameter areas where there are two ecologically stable equilibria.

Parameterization
All biomass densities are expressed in milligrams per liter, and time is expressed in days. Per capita mortality rates (m S , m L , and m A ) are stage specific, while the other consumer parameters are either mass specific (maintenance rate, attack rate, and maximum ingestion rate) or dimensionless and therefore the same for all three stages. For the adult body weight (M A ) a value of 0.1 mg is chosen; the weight of a newborn individual is 0.001 mg. Both z 1 and z 2 have a value of 0.1, which means that small and large juveniles mature to the next stage after they have achieved a tenfold increase in their weight. Following de Roos and Persson (2013; box 3.4), we assume that the mass-specific maintenance rate, the mass-specific attack rate, the massspecific maximum ingestion rate (which is the inverse of the handling time), and the per capita mortality rate are proportional to the quarter power of the adult body size (Peters 1986;Brown et al. 2004). Hence, all these rates scale as cM 20:25 A , with different scaling constants c, where M A is expressed in grams. The scaling of all rates with adult body mass also implies that, qualitatively, model predictions are independent of the choice of M A . Varying M A changes the timescale over which evolutionary change occurs but not the end points. Scaling constants are chosen for invertebrate species. For the mass-specific maintenance rate a scaling constant of 0.01 is chosen (Yodzis and Innes 1992;Brown et al. 2004;de Roos and Persson 2013). For the mass-specific maximum ingestion rate a scaling con-stant of 0.1 is chosen (Hansen et al. 1997;de Roos and Persson 2013), such that the handling time scales with 10M 0:25 A . For the background mortality rate a scaling constant of 0.002 is used (Gillooly et al. 2001) for large juveniles and adults. Mortality rates are often size specific and often decrease with size (e.g., Sogard 1997;Hampton 2000). To take this into account, we use for small juveniles a scaling constant of 0.002 or 0.004, to study how increased juvenile mortality affects the results. Ingested biomass of both food sources is assimilated with an efficiency of 0.5 (Peters 1986). For the food sources turnover rate we assume a value of 0.1 per day, which is equal to the metabolic rate of an adult with a body size of 0.1 mg. In this way the food source turnover rate takes place at approximately the same rate as consumer turnover through metabolism. The maximum food source densities and the mass-specific attack rates are the only volume-related parameters in the model. Changing the values of these parameters has a qualitative effect on model dynamics only when these changes affect the products a 1 ⋅ X 1,max or a 2 ⋅ X 2,max . Changes in attack rate and maximum food source densities that leave these products unaffected merely represent a scaling of the volume in which the system exists and therefore change model dynamics only quantitatively. The attack rates are determined by parameters w, A max , and q. We adopt a maximum value of 0.06 for the scaling constant of the massspecific attack rate with M 20:25 A , such that a 1 p 0:6 when w p 1. Therefore, A max p 0:6. For parameter q we assume a value of 1 or 1.2. In the first case, all individuals have the same mass-specific attack rate. In the latter case, small juveniles are 1.2 times as effective in feeding on the original food source as large individuals.

Results
A mutant that increases its feeding rate at any life stage increases its lifetime reproductive output (eq. [9]). An increase in the feeding rate in the juvenile stages will increase the somatic growth rate of the mutant, while an increase in the feeding rate in the adult stage will increase its reproduction rate. A mutant that has a higher food intake (which increases with the product of food density, the attack rate, and the preference) than the resident can therefore invade. The most advantageous strategy for large individuals is therefore to search for the food source that is the most abundant and specialize on this food source as well. However, the smallest individuals can feed only on the original food source, and their growth and survival critically depend on this food source. Since we assume that specialization on one food source comes at the expense of specialization on the other, this leads to a trade-off between early and late foraging success. Because of this trade-off, large individuals that specialize on the alternative food source produce offspring that are maladapted to the original food source. In the first part of this section, we study the evolution of ontogenetic niche shifts when the two food sources occur in the same habitat (b p 1). In this case, only the specialization w evolves. In the second part, we consider the case where the two food sources occur in two nonoverlapping habitats (b p 0).

Two Food Sources Occurring in the Same Habitat
When the two habitats overlap completely, the consumer does not need to choose between habitats and can therefore feed on both food sources simultaneously. In this case, there is selection only on the foraging skills of the consumer (w), that is, on the attack rates (a 1 and a 2 ) on the two food sources. Depending on the value of X 2, max , we find two qualitatively different evolutionary outcomes. Individuals either completely lose their ability to forage on the alternative food source or they do feed on the alternative food source but are not very efficient in doing so (a 2 remains low). Figure 1A shows how specialization w evolves when the maximum density of the alternative food source is very low. Independent of the initial value of w, it will always evolve to 1 ( fig. 1A, 1B). Individuals will therefore lose their ability to feed on the alternative food source (a 2 → 0) and will feed only on the original food source. In this case, large individuals cannot eat the alternative food source, even though it occurs in the same habitat, because they do not have the right morphology to do so. When X 2, max is very low, the density of the alternative food source is much lower than that of the original food source. It is therefore beneficial for large individuals to specialize completely on the original food source and thereby ignore the alternative food source. Figure 1C shows a typical evolutionary time course for intermediate and high values of X 2, max . Independent of the initial value, w always evolves to values just below 1. The pairwise invasibility plot of figure 1D shows that this ESS is convergent stable. Therefore, once this point is reached, no other mutant can invade in the population. Because specialization w evolves to high values, individuals broaden their diet when they grow larger, but they are not very efficient in feeding on the alternative food source (the attack rate a 2 remains close to 0). Apparently, the trade-off between early and late foraging success hinders specialization on the food source used later in life. Figure 2A shows to which value w evolves as a function of X 1, max and X 2, max . Specialization w always evolves to a convergent stable strategy (CSS). When the maximum density of the alternative food source is very low, w evolves to a value of 1, meaning that individuals have lost their feeding ability on the alternative diet (a 2 p 0). The alternative food source is therefore not exploited at all, and an ontogenetic niche shift does not evolve. For increasing values of X 2, max , w evolves to slightly lower values (minimum value of specialization w equals 0.95, a 2 p 0:03), meaning that large individuals can feed on the alternative food source but are not very efficient in feeding on this food source. Surprisingly, for very high values of X 2, max the CSS value of w increases again, and large individuals become even more inefficient in feeding on the alternative food source. Increasing X 2, max will increase adult food availability and therefore fecundity. This will increase competition among small juveniles. Apparently, it is in that case even more important for small juveniles to be highly specialized on the original food source. In summary, large individuals cannot specialize on the alternative food source, even when this food source is very abundant, when this negatively affects their offspring. Because of the habitat overlap, individuals do broaden their diet over their lifetime, but they are not very good at feeding on the alternative food source.
Since the minimum prey size a consumer can eat often increases with consumer size (Werner 1988), we also study the evolution of specialization w when small juveniles have an attack rate 1.2 times that of large juveniles and adults per gram body weight on the original food source. The form of the trade-off between the attack rates remains the same for all stages (eq. [5]). Figure 2B shows that even in this case, individuals specialize on the original food source and are not very efficient in feeding on the alternative food source. When small individuals are better competitors for the original food source than larger ones, w can evolve to slightly lower values, compared to the situation where all stages have the same competitive abilities. This is possible because the trade-off in feeding efficiencies affects small juveniles to a lesser extent than large juveniles and adults.
Mortality rates often decrease with body size (e.g., Sogard 1997;Hampton 2000). We study the effect of sizedependent mortality by increasing the per capita mortality rate for small juveniles to 0.04 while keeping the other parameters the same. Figure 2C shows that the results are comparable to those of the model analysis with equal mortality rates for all stages. As before, we find that consumers do not specialize on the alternative food source when this negatively affects the performance of small juveniles.

Two Food Sources Occurring in Two Nonoverlapping Habitats
When the two habitats do not overlap at all, f determines on which food source the large individuals feed. When f p 0, for example, there is a complete ontogenetic diet shift and large individuals feed only on the alternative food source. We refer to the parameter f as the food choice (equivalent to habitat choice in this case) and to w as the (degree of) specialization on the original food source. Since we are interested in the question how a niche shift can evolve in species that do not have one, we assume that ini-tially all individuals feed on the original food source (f p 1) and are specialized in feeding on the original food source (w p 0:9, a 1 p 0:54, a 2 p 0:06). We used the canonical equation of adaptive dynamics to study the evolutionary dynamics of the model for many different combinations of maximum food source densities. We found : Evolutionary outcome when the two food sources occur in the same habitat (b p 1) for both a low (A, B) and a high (C, D) value of X 2, max . A, Change in the specialization parameter w over evolutionary time, starting from w p 0:2, when X 1,max p 3 and X 2,max p 0:8. Parameter w evolves to a value of 1, meaning that individuals will completely lose the ability to feed on the alternative food source. B, Pairwise invasibility plot (PIP) for X 1,max p 3 and X 2,max p 0:8, showing that w always evolves to a value of 1 independent of the starting values. White areas indicate positive invasion fitness and gray areas negative invasion fitness. C, Change in the specialization parameter w over evolutionary time, starting from two different initial conditions (w p 1 or w p 0:16), when X 1,max p 3 and X 2,max p 2:5. Independent of the starting value, w evolves to a value of 0.96, meaning that large individuals are specialized on the original food source and are not very efficient in feeding on the alternative food source. D, PIP showing the location of the evolutionarily singular strategy for X 1,max p 3 and X 2,max p 2:5. Independent of the initial value, w will always evolve to a value of 0.96. White areas indicate positive invasion fitness and gray areas negative invasion fitness. Evolutionary time units are arbitrary in A and C (see app. A, available online).
three qualitatively different evolutionary outcomes, which are described below. Figure 3A shows a typical evolutionary time series that occurs for most combinations of X 1, max and X 2, max . Food specialization w always increases over evolutionary time and will evolve to its maximum value, which equals 1. Food choice f first decreases over evolutionary time but increases later and ultimately evolves to a value of 1 as well.
This evolutionary pattern can be explained by the change in the specialization-adjusted food source densities over evolutionary time, which are shown in figure 3B. Initially, food choice f will evolve to lower values, since large individuals can increase their food intake by feeding on the alternative food source (first part of fig. 3B). However, at the same time specialization w increases, since there is apparently selection for increased feeding efficiency on the original  Figure 2: Evolutionary outcome for different combinations of X 1, max and X 2, max when the two habitats completely overlap (b p 1). A, All individuals experience the same per capita mortality rate and have the same foraging abilities on the original food source, independent of their size. For very low values of X 2, max , the value of the specialization parameter w evolves to 1. For increasing values of X 2, max w first decreases to a minimum of 0.95. For higher values of X 2, max the value of w increases again. B, All individuals experience the same per capita mortality rate, but small juveniles are 1.2 times as efficient in feeding on the original food source as larger individuals. As in A, w first decreases with increasing X 2, max and increases afterward. Specialization w now evolves to lower values, compared to the case where all individuals have the same competitive abilities. However, w still evolves to relatively high values (minimum value is 0.9). C, All individuals have the same foraging ability on the original food source, but small juveniles experience a higher mortality rate than the large juveniles and adults. The minimum value to which w can evolve is 0.95.  (fig. 3A). Because of this increase in specialization w, large individuals become less efficient on the alternative food source, and it is no longer beneficial to feed on this food source (last part of fig. 3B). Therefore, the direction of evolutionary change in food choice f reverses, and it will now evolve to higher values. Ultimately, both food choice f and specialization w evolve to their maximum values, which equals 1 for both parameters. In this case, no niche shift evolves, and the consumers even lose their capability to consume the alternative food source. Figure 3C shows a typical evolutionary time series when the maximum density of the alternative food source is very high while the maximum density of the original food source has low or intermediate values. In this case, food choice f evolves to a value of 0 while the specialization w evolves to a value slightly lower than 1 (in fig. 3C, w p 0:89, a 2 p 0:07, and a 1 p 0:53). When X 2, max is very high, it is beneficial for large individuals to feed on the alternative food source, independent of the value of specialization w ( fig. 3D). Therefore, food choice f will evolve to a value of 0, and the consumers have a complete ontogenetic diet shift. However, even though large individuals feed completely on the alternative food source, specialization on the new food source is not possible, and specialization w evolves to relatively high values. Even when the productivity of the alternative food source is very high, the trade-off between early and late foraging success hinders specialization on the food source used later in life.
When both X 1, max and X 2, max are very high, the results are comparable to the situation described above. Even though large individuals spend most of their time searching for food in the habitat with the alternative food source, they never specialize on this food source. However, in this case the population never reaches an ESS. Figure 3E shows a typical evolutionary time series when the two traits always change over evolutionary time. The evolutionary cycling occurs because the ESS corresponds to an equilibrium that is ecologically unstable. For low values of food choice f, when the overlap in diet between small and large consumers is small, there are two stable ecological equilibria, separated by an unstable equilibrium (for a more detailed discussion about this bistability when small and large consumers feed on different food sources, see Schreiber andRudolf 2008 andGuill 2009). In one of the stable ecological equilibria, specialization w evolves to lower values while food choice f evolves to higher values. The evolutionary directions are reversed in the other stable equilibrium. Because the equilibrium that is evolutionarily stable is ecologically unstable, it is never reached, and the system always cycles between different values of food choice f and specialization w. In this case, the consumers exhibit a partial diet shift but are never specialized on the alternative food source. The profitabilities of the two food sources also change over time because of the evolutionary cycling ( fig. 3F). Figure 4A shows the boundaries of the parameter regions in the X 1, max -X 2, max space where the different evolutionary outcomes described above occur. For most combinations of X 1, max and X 2, max , an ontogenetic niche shift cannot evolve, and the alternative food source remains unexploited. For very high values of X 2, max , large individuals spend most or even all of their time searching for the alternative food source. However, large individuals will never specialize on the alternative food source. When a complete ontogenetic diet shift evolves, the lowest value to which the specialization w can evolve equals 0.88. When there is evolutionary cycling, the minimum value that specialization w can reach equals 0.83.
When smaller individuals are more efficient in feeding on the original food source than large individuals (q p 1:2), we find qualitatively the same results ( fig. 4B). As before, for most combinations of X 1, max and X 2, max an ontogenetic diet shift does not evolve. For high values of X 2, max , the alternative food source is exploited by large individuals, but they cannot specialize on this new food source. The minimum value to which specialization w can evolve is slightly lower than that in the situation where all individuals have the same competitive abilities. Furthermore, the parameter area for which consumers exploit the alternative food source is slightly larger. A diet shift never evolves when the small individuals experience an increased per capita mortality rate of 0.04 (figure not shown). The aldensity and the degree of specialization of consumers on the food source. The food source encounter rates (X 1 * a 1 and X 2 * a 2 ) are therefore plotted to show which food source is the more profitable to forage on. A, X 1,max p 1 and X 2,max p 8. In this case, both f and w will evolve to a value of 1, and individuals will feed only on the original food source and even lose their ability to feed on the alternative food source. B, X 1,max p 1 and X 2,max p 8. Initially, the alternative food source is the more profitable food source for large individuals to forage on. However, because of the evolutionary change in specialization w (see A), the original food source becomes more profitable over evolutionary time. C, X 1,max p 6 and X 2,max p 9. For high values of X 2, max a complete diet shift will evolve (f p 0), but large individuals are not very efficient in feeding on the alternative food source (w p 0:89). D, X 1,max p 6 and X 2,max p 9. Even though the efficiency with which large individuals feed on the alternative food source remains low, the alternative food source is for large individuals the more profitable food source to forage on. E, X 1,max p 8 and X 2,max p 9. When both X 1, max and X 2, max are very high, the population will never reach an evolutionary end point. The two parameters will therefore always change over time. In this case, the large individuals spend most of their time in the habitat with the alternative food source (f p 0:220:3) but are not very efficient in feeding on this food source (w p 0:84-0:88). F, X 1,max p 8 and X 2,max p 9. Because both the specialization w and the food choice f change over evolutionary time, the food source profitabilities fluctuate as well.
ternative food source always remains unexploited in this case.
To summarize, an ontogenetic diet shift can evolve only for very high values of X 2, max , but specialization on the alternative diet is never possible. Increasing the competitive abilities of the smallest individuals increases the parameter area where a complete ontogenetic diet shift can evolve. On the other hand, increasing the mortality rate of the smallest individuals will decrease the parameter area where a complete ontogenetic diet shift can evolve.

Discussion
In this study, we found that it is advantageous for individuals to broaden their diet or even completely switch to an alternative diet during ontogeny when this increases their food intake. Surprisingly, however, consumers do not specialize on the alternative food source when this negatively affects the performance of small juveniles. Small juveniles are not able to feed on the alternative food source and are therefore completely dependent on the original food source for their survival and growth. Apparently, it is important that performance of small juveniles is high, so that they mature quickly into the next stage. Even though adults might increase their reproduction rate if they specialize on the alternative food source, this would, because of the trade-off between early and late foraging success, result in offspring that do not perform very well in the first part of their life cycle. Those individuals are outcompeted early in their life by individuals that are better foragers on the original food source. It therefore turns out to be evolutionarily more important to produce a few offspring that are excellent competitors than to produce many offspring that are not very efficient in feeding during the first part of their lives. The trade-off between early and late foraging success impedes the evolution of an ontogenetic niche shift. Large individuals are able to broaden or change their diet over their lifetime, but they always have a low efficiency on the food source used later in their life.
When the two food sources occur in the same habitat, it is even harder for large individuals to specialize on the alternative food source, compared to a situation where the two food sources are separated in space. Because of the overlap, large juveniles and adults always have access to both food sources, while small juveniles can feed only on the original food source. This larger food availability for large juveniles and adults leads to a high reproduction rate of new offspring. Because of the many offspring produced, competition in the small-juvenile stage is very strong (de Roos et al. 2007). This impedes specialization of larger individuals on the alternative food source if that leads to maladapted offspring and thus even stronger competition : Evolutionary outcome for different combinations of X 1, max and X 2, max when the two habitats are completely separated in space (b p 0). For low values of X 2, max no diet shift can evolve, because the density of the alternative food source is very low (area 1). For very high values of X 2, max (area 2), a complete diet shift can evolve, but the consumers are not specialized on this diet (w between 0.88 and 0.92). For very high values of both X 1, max and X 2, max (area 3), the population will never reach an evolutionary end point. While large individuals feed most of their time on the alternative food source (f p 0-0:45), they are not very efficient in feeding on this food source. A, All individuals experience the same per capita mortality rate and have the same foraging abilities on the original food source, independent of their size. The minimum value to which w evolves when there is a complete diet shift is 0.88. In the parameter area where there is evolutionary cycling, the minimum value that w can reach is 0.83. B, All individuals experience the same per capita mortality rate, but small juveniles are 1.2 times as efficient in feeding on the original food source as larger individuals. The minimum value that w can reach is 0.77 in the area where there is evolutionary cycling and 0.87 in the area where a complete diet shift evolves.
in this stage. Therefore, when the two food sources overlap in space, consumers expand their niche over ontogeny but can never specialize on the alternative food source. Previous studies assumed that switching niches during ontogeny is a way to maximize growth rates across the life history (Werner and Gilliam 1984;Werner 1988). These studies did not consider the ecological conditions that might favor the evolution of ontogenetic niche shifts in the first place and mainly focused on the timing of the shift. We showed that there is a strong feedback between environment and strategy and that this feedback should be taken into account, as it determines whether an ontogenetic niche shift evolves or not.
A critical assumption in our study is that the different life stages are correlated, such that specialization of large individuals on the alternative food source results in offspring that are not very efficient in feeding on the original food source. We showed that this trade-off prevents specialization on the alternative food source, even when this food source is very abundant. It is, however, difficult to observe this prediction in empirical systems, because to do so would require comparison of morphologies and feeding efficiencies of populations, ecotypes, or closely related species with and without an ontogenetic niche shift. As far as we know, there is only one empirical study that gives some support to our prediction (Shedd et al. 2015). While most kokanee salmon feed only on macroinvertebrates, there is one population in Alaska that switches to piscivory during ontogeny (Shedd et al. 2015). Even though the diet of large individuals consists almost solely of fish, the morphology of these fish is not adapted to piscivory. While there is only limited evidence for a trade-off between early and late foraging success, there are, however, many studies (e.g., Werner 1977;Svanback and Eklov 2003;Jones et al. 2013) that show that morphological traits that facilitate feeding on a certain type of food (e.g., algae) are different from morphological traits that facilitate feeding on another type of food (e.g., fish). On the basis of these observations, we think that it is reasonable to assume the trade-off between early and late foraging success.
When small individuals are relatively more efficient in feeding on the original food source than large individuals, the results are qualitatively the same. However, compared to the situation where all individuals have the same foraging abilities, large individuals can now specialize slightly more on the alternative food source. In this case, the trade-off between early and late foraging success is less strong, since small juveniles are less affected than large juveniles and adults. In the absence of this trade-off, it is therefore to be expected that specialization on the alternative food source is possible. Hence, in species with an ontogenetic niche shift there is probably strong selection to break up the correlation between different stages when the alternative food source is very abundant. It is often thought that metamorphosis has evolved to decouple the different life stages and allows for the independent evolution of stage-specific traits (Moran 1994). It is, however, still unclear to what extent metamorphosis can decouple different life stages. Some studies have reported independent evolution of larval and adult traits (Parichy 1998;Saenko et al. 2012), while others have found strong correlations of traits between different stages (Gower and Webster 2004;Fellous and Lazzaro 2011). Apparently, some traits expressed in different life stages can evolve independently, while other traits are correlated.
Even if metamorphosis can break up the correlations between different life stages, such that they can evolve independently, metamorphosis also entails costs. During metamorphosis, some species cannot feed at all (e.g., holometabolous insects) or feeding becomes less efficient (e.g., flatfishes; Geffen et al. 2007). Since metamorphosis costs energy, species often lose body mass during the transformation from larva to juvenile (Thiyagarajan et al. 2003;Downie et al. 2004). Furthermore, metamorphosing individuals are often more vulnerable to predation and therefore often experience high mortality rates (e.g., Wassersug and Sperry 1977). Metamorphic chorus frogs (Pseudacris triseriata), for example, are not well adapted to either land or water, compared to pre-and postmetamorphic individuals, and experience high predation risk by the garter snake (Thamnophis sirtalis). It remains a question for further research under which ecological conditions the potential benefits from metamorphosis can outweigh its disadvantages.
We have shown that a change in diet over an individual's lifetime could promote the evolution of metamorphosis. However, factors other than diet could explain the origin of metamorphosis as well, such as dispersal, mate finding, or habitat selection (Moran 1994). A shift in diet could therefore also be a result of selection for, for example, dispersal. Even though other factors might have driven the evolution of metamorphosis as well, it is thought that a shift in diet often has been the first step in evolutionary history toward complex life cycles with metamorphosis. Fossils of early amphibians, for example, showed that not the habitat shift but the shift in diet from feeding under water as a larva to feeding on land as an adult was a crucial factor for the evolution of metamorphosis (Schoch 2009). It would be interesting to study whether metamorphosis is more likely to evolve because of a diet shift or because of other factors, such as dispersal.
In cases when two food sources occurred in different habitats, we studied only the evolutionary dynamics, assuming that initially a niche shift did not exist. It is, however, possible that there are other evolutionary attractors present that can be reached when starting from different ancestral states. We did not study the global evolutionary behavior of the system and looked only at the evolutionary dynamics, starting from one particular situation, because the main question that we are interested in is how a niche shift can evolve in species that do not have one. Therefore, the simplifying assumption was made to look only at the evolutionary dynamics on a local scale. Further work will address whether there are multiple evolutionary attractors present in the system when starting from different initial conditions.
A limitation of this study is that we analyzed only a linear trade-off function, where every increase in the attack rate on the alternative food source leads to an equal decrease in the attack rate on the original food source. There are, however, different trade-off shapes possible, and the shape of the trade-off function can have dramatic effects on the evolutionary outcome (e.g., Kisdi 2001;Egas et al. 2004). A different trade-off shape could, for example, lead to evolutionary branching (Geritz et al. 1998). It is, however, beyond the scope of this article to evaluate the effects of different trade-off shapes on the evolution of ontogenetic niche shifts.
Another simplifying assumption in this study is that of determinate growth of individuals. We assumed that individuals stop growing after reaching maturity, which is not always true. A shift in diet might increase growth rates and therefore allow for larger adult body sizes. Larger-sized individuals often have higher fecundity, which makes it even more profitable to change diet. It has been shown in a model for parasites that ontogenetic host switching can evolve because of the advantage of an increased body size at maturity and higher fecundity (Parker et al. 2003). However, Parker et al. (2003) used a density-independent model and did not take into account the feedback between individuals and the environment. While this might be valid for parasitic organisms, we believe that the feedback between environment and the different strategies of individuals cannot be ignored when studying diet shifts in freeliving animals.
To analyze the robustness of our result with regard to major changes in both the model structure and the model parameters, we analyzed a fully size-structured population model (app. B). This model is an extension of the model described by Persson et al. (1998) but includes an additional food source. Growth is indeterminate, and the maximum size of individuals depends on the food source densities. The attack rates were modeled as hump-shaped functions of the body mass of an individual. Because of these specific functions, large individuals become less efficient on the original food source. The model was parameterized for the interaction between roach (Rutilus rutilis) and two zooplankton food sources. We found again that individuals do not specialize on the food source used later in life. This analysis shows that our results do not depend on the parameterization or the specific assumptions of the stage-structured biomass model, such as determinate growth and the linear increase of the attack rate with increasing size.
Given the high number of species with ontogenetic niche shifts, one must conclude that this is a very successful life-history strategy. We showed that individuals switch to an alternative diet later in life as a way to maximize food intake. However, it is not possible to specialize on the alternative food source if this leads to maladapted offspring. There is therefore probably selection to decouple the different life stages such that they can specialize independently on their different food sources. The evolution of metamorphosis could be a way to break up the trade-off between performances on different diets between different life stages. Our results hence suggest that the evolution of an ontogenetic niche shift could induce the evolution of a metamorphosis.