Introduction

Individual variation exists in almost all quantitative traits. For example, some individuals grow faster than others even when they are seemingly identical (e.g., the same species, same age, same sex, and same size) (e.g., Bottrell 1975; Prasad et al. 2012). In behavior, consistent between-individual variation (i.e., personality) (Gosling 2001) and correlated expressions of personality across contexts (i.e., behavioral syndrome) are widely studied (e.g., Sih et al. 2004; Garamszegi et al. 2013). In addition, within-individual behavioral variation is expressed when individual animals exhibit variable behavioral expressions when they are repeatedly observed under the same condition (Bee 2004; Bonte et al. 2009). For example, hermit crabs withdraw into their shells when startled and emerge again when they are left alone. The duration of reemergence is variable when the same individuals is repeatedly observed (Stamps et al. 2012). Realized behavioral variation in common experiments would include both between- and within-individual variation, and although within-individual variation explains a larger proportion the total variation than between-individual variation (Bell et al. 2009), little has been studied about the significance of within-individual variation, especially in non-human animal research (Stamps et al. 2012).

The biological significance of within-individual behavioral variation is not well understood (Stamps et al. 2012). In studies of foraging behavior, optimal foraging models are commonly used to understand the ultimate significance of observed behavior (Abrams 1992; Stephens and Krebs 1986; Křivan and Diehl 2005). Such behavioral models typically predict the static optimal behavior that maximizes the fitness (or a surrogate of fitness) of individuals. For example, when the mean and within-individual variance of behavior are \(\mu\) and \(\sigma ^2\), respectively, it is implicitly assumed \(\sigma ^2=0\) (or simple model scenarios in which \(\sigma ^2=0\) is optimal are used), and the optimal expression in \(\mu\) is investigated (e.g., Pulliam 1974; Charnov 1976). Therefore, although qualitative model predictions (e.g., on average, prey should decrease their activity as the predator density increases) may be tested empirically (e.g., Anholt et al. 2000; Persons and Rypstra 2001), models make no predictions for within-individual behavioral variation or assumes that within-individual variation is nil as any deviation of the optimal expression is suboptimal.

This study examines the evolution of within-individual behavioral variation in the framework of optimal foraging theory. (In this study, unless otherwise stated, variance indicates within-individual variance.) A commonly used predation scenario is considered (described in details below). In the model, the optimal solution is well known for the situation under a simple biological scenario where \(\sigma ^2=0\) is optimal (Charnov 1976; Stephens and Krebs 1986). A few relaxations of model scenario are considered, which are (1) finite foraging period and (2) stochasticity. The finite foraging duration is important because although the energy acquisition rate (as a surrogate of fitness) is calculated over an indefinitely long period in conventional models (e.g., Pulliam 1974; Charnov 1976), the foraging duration of foragers is limited. In addition, when the duration is limited, stochasticity becomes particularly important because some individuals are more successful than others due to chance, and within-individual variation (\(\sigma ^2\)) interacts with the stochasticity and influences the foraging success of individuals.

The model

An individual-based model is used to simulate a simple foraging scenario. The ecological scenario represents a common predation scenario on the basis of which Holling’s type II functional response was derived (Holling 1959). Predators are in one of two states: searching or handling. Searching predators search for prey, and the rate of prey capture increases linearly with prey density (i.e., aR, where R is prey density and a is the parameter that determines the linear relationship). Upon capturing a prey, the predator spends a duration (i.e., handling time) for handling the prey. The amount of energy extracted from the prey increases with the duration of handling (e.g., Samu 1993; Cohen and Tang 1997) and is described by \(\alpha h/(\beta +h)\), where \(\alpha\) and \(\beta\) determine the saturating relationship between handling time and energy intake. Once a predator finishes handling a prey, it begins to search for another prey. This model assumes that predators do not interact with each other during foraging and prey do not exhibit complex behavior (e.g., defense) such that handling time is solely determined by the predator.

This study examines the evolution of handling time, where handling time is described by both its mean, \(\mu\), and variance, \(\sigma ^2\). When a predator captures a prey, handling time is simulated from a gamma distribution whose shape parameter is \(\mu ^2/\sigma ^2\) and the scale parameter is \(\sigma ^2/\mu\) (Okuyama 2012b). In other words, predators exhibit variation in handling time and the average and variance of handling time are \(\mu\) and \(\sigma ^2\), respectively. When a predator has \(\sigma ^2=0\), it always spends time \(\mu\) on handling a prey, and \(\mu\) and \(\sigma ^2\) are individual traits and vary among predator individuals. When a predator is not handling a prey, it attempts to capture a prey, and the time needed to capture a prey is simulated by an exponential distribution whose rate parameter is aR (Okuyama 2012a, b).

The simulation repeats simple predation processes for a duration G, representing the generation time of predators. It is assumed that a predator that is in the middle of extracting energy from a captured prey at time G abandons the prey and receives the corresponding energy. The simulation steps for each individual are as follows:

  1. 1.

    Initialize time t, and acquired energy e: \(t=0\) and \(e=0\).

  2. 2.

    Simulate search time, s, from an exponential distribution whose rate parameter is aR.

  3. 3.

    Simulate handling time, h, from a gamma distribution whose shape parameter \(=\mu ^2/\sigma ^2\) and scale parameter \(=\sigma ^2/\mu\).

  4. 4.

    If \(t + s < G\),

    • set \(e = e + \frac{\alpha \,{\text {min}}(h, G-t-s)}{\beta + {\text {min}}(h, G-t-s)}\),

    • set \(t = t + h + s\) and repeat from step 2.

  5. 5.

    If \(t + s \ge G\), end the simulation.

The optimal handling time is well known for fixed handling time and unlimited foraging duration. In particular, this scenario is identical to the problem considered in the marginal value theorem (Charnov 1976). Although the original model is driven by a different ecological scenario (i.e., foraging in patches), the same model can be applied to the predation scenario considered here (Cook and Cockrell 1978). The predicted optimal handling time is h that maximizes,

$$\begin{aligned} \frac{\alpha h}{\beta +h}\frac{aR}{1+ahR} \end{aligned}$$
(1)

and is solved as \(\hat{h}=\sqrt{aR\beta }/(aR)\). However, this solution does not hold when we consider the finite foraging duration and stochasticity as assumed in the simulation described above.

Selection and evolution

A genetic algorithm is used to study the evolution of handling time. There are N individuals in the population, and \(e_i\) is the foraging success of the ith individual at the end of generation time, G. The relationship between foraging success and reproductive potential is characterized by \(q_i=e_i^Q\), where the parameter Q determines the relationship between e and the reproductive potential. In addition, a sigmoidal relationship \(q_i=e_i^2/((\sum e_i/N)^2 + e_i^2)\) is also considered. The number of offspring produced by N individuals is simulated from a multinomial distribution whose size parameter is N and the probability parameter p is a vector consisting of N values whose ith element is \(q_i/(q_1+\cdots +q_N)\). The traits of offspring are similar but not identical to those of their parents due to mutations. A parent whose trait values are \(\mu _h\) and \(\sigma ^{2}_{h}\) reproduces offspring whose mean trait value is randomly generated by a normal distribution with mean \(\mu _h\) and variance \(\epsilon _{\mu }\), and whose variance trait value is randomly generated by a normal distribution with mean \(\sigma ^{2}_{h}\) and variance \(\epsilon _{\sigma ^2}\). Thus, \(\epsilon _{\mu }\) and \(\epsilon _{\sigma ^2}\) describe mutations. If a generated trait is negative, it is set to 0. The mean of handling time \(\mu\) of the initial population is simulated from a uniform distribution whose range is (\(\hat{h}-0.5,\hat{h}+0.5\)), and the variance of handling time \(\sigma ^2\) is simulated from a uniform distribution whose range is (0, 0.1). Each simulation consists of 5000 generations that is a period long enough for convergence of the trait evolution (see “Results” section). Because of the mutation, some genetic variation among individuals always exist even after many generations. Default parameters, \(a=0.1, \alpha =1, \beta =10, \rho =0.1, \epsilon _{\mu }=\epsilon _{\sigma ^2}=0.0001, Q=1 (0.5,2), G=25 (25,1000), R=10 (5,50)\), and \(N=1000\), are used unless stated otherwise. The numbers in parentheses indicate the minimum and maximum values used in the sensitivity analysis. All simulations were performed using R version 3.0.3 (R Core Team 2014).

Results

Regardless of the initial traits of the individuals of the first generation, the population average of the mean and variance of handling time converge. Two factors that have a qualitatively small effect on the evolution of handling time are the shape of fitness function (i.e., the relationship between e and q) (Fig. 1) and the generation time G (Fig. 2). When the relationship between foraging success e and fitness surrogate q is concave up (\(Q=2\)), the trait values fluctuate relatively little. The degree of fluctuation is high when the relationship is concave downward (\(Q=0.5\)), but convergence still takes place. Because nonlinearity induces Jensen’s inequality (see “Discussion” section), in the following analysis, results based on \(Q=1\) are shown such that they are not confounded by the nonlinearity of the fitness function.

Fig. 1
figure 1

Trajectories of the evolution of the mean and variance of handling time. The trajectories of four dispersed populations are shown. Arrows indicate the starting point and the direction of evolution. Q determines the relationship between foraging success and reproduction: concave up (\(Q=2\)), linear (\(Q=1\)), and concave down (\(Q=0.5\))

Fig. 2
figure 2

Population averages of the mean and variance of handling time after 5000 generations at different generation times, \(G\). Results of 50 independent simulations are shown as boxplots

Both the mean and variance of handling time decreased with an increase in prey density (Fig. 3). One way that prey density influences the evolution is through variation in search time, s. In the simulation, the realized search periods are assumed to fit an exponential distribution. Under this assumption, the variance of search time decreases with an increase in prey density because the mean and variance of the exponential distribution are \((aR)^{-1}\) and \((aR)^{-2}\), respectively. To test the effect of the variance of search time on the evolution of handling time, modified simulations were conducted in which search times were simulated from a gamma distribution because the variance of gamma distribution can be adjusted for a given mean value. The mean of the gamma distribution was set to \((aR)^{-1}\) and its variance was varied. The results show that the optimal variance of handling time increases with an increase in the variance of search time (Fig. 4).

Fig. 3
figure 3

Population averages of the mean and variance of handling time after 5000 generations at different prey densities, \(R\). Results of 50 independent simulations are shown as boxplots

Fig. 4
figure 4

Population averages of the mean and variance of handling time after 5000 generations at different variance levels of search periods. The mean search duration is fixed, \(1/(aR)\) where \(R=10\). Results of 50 independent simulations are shown as boxplots

To further examine why positive behavioral variance is maintained, another scenario was simulated. In this scenario, the average trait \(\mu\) is heritable, whereas the variance trait \(\sigma ^2\) is fixed, and all individuals in the population have the same \(\sigma ^2\). The results reveal that average foraging success is highest when \(\sigma ^2=0\), but foraging success for successful foragers (i.e., top 5 %) grows with \(\sigma ^2\) (Fig. 5).

Fig. 5
figure 5

The population average and maximum of foraging success, \(e\), after 5000 generations at different levels of fixed \(\sigma ^2\). Results of 50 independent simulations are shown as boxplots

Discussion

The results show that natural selection acts not only on the mean but also on the within-individual variance of handling time. In the course of evolution, selection can act on the variance rather than the mean (e.g., vertical trajectories in Fig. 1), suggesting the ultimate significance of within-individual variation. In addition, the expression of within-individual variation can be density-dependent, which can induce important density dependence in many ecological processes (discussed below).

The evolution of the density-dependent variance in handling time is in part caused by the predictability of the environment. When the environment is predictable (i.e., small variance in duration to capture a prey), an advantageous strategy for predators is to express little (or no) behavioral variance. Prey density is one of the factors affecting the uncertainty of the environment. When prey density is low, variation in search time is high, and some individuals that express variable handling times can perform significantly better than the average individual by chance (Fig. 5). Consequently, some of the most successful (and unsuccessful) individuals (i.e., high e) are likely to be those with large \(\sigma ^2\). If the relationship between foraging success and fitness is concave up (e.g., \(Q=2\)), this can facilitate the selection of individuals with high within-individual behavioral variation.

Positive valued within-individual variation can evolve even when the fitness function is not concave up (e.g., Fig. 1). In this study, a multinomial distribution is used to translate the foraging success into reproduction. The elements of a multinomial outcome are discrete and have negative covariances due to the constraints on the population size (i.e., fixed N). These properties of the multinomial distribution can facilitate the evolution. To illustrate the mechanism, a simple situation where there are three individuals is considered here. The behavioral traits of the three individuals are assumed to be \(u-d, u,\) and \(u+d\). For simplicity, the foraging success of each individual is identical to the behavioral trait (i.e., an individual with its behavioral expression u gains u units of energy from foraging success). Then, the probability parameter vector of the multinomial distribution is (\((u-d)/3u, u/3u, (u+d)/3u\)). Under these conditions, although the expected numbers of offspring are (\((u-d)/u, u/u, (u+d)/u\)), the mean trait of the offspring will increase when \(d>0\). For example, suppose \(u=5\) and \(d=4\), three foragers will gain 1, 5, and 9 units of energy and reproduce three offspring in total. The probabilities in the multinomial distribution are 1/15, 5/15, and 9/15, respectively. The expected numbers of offspring are 3/15, 15/15, and 27/15, respectively. However, actual realization of reproduction is stochastic, and there are 10 different possible ways in which the reproduction is realized: (3, 0, 0), (2, 1, 0), (2, 0, 1), etc. For each of the specific outcomes, we can calculate its probability of occurring. Suppose the offspring and parent have the identical trait value, the expected trait value in the offspring population is 7.13 in this specific example (i.e., the average trait value evolves from 5 to 7.13). Figure 6 shows the expected trait value of the offspring for a variety of d. This result shows that the variation in foraging success created by individuals with high within-individual variation can facilitate the maintenance of within-individual variation. In scramble/contest competition dichotomy (Łomnicki 2009), contest competition is likely to induce similar effects assumed in the multinomial distribution. This includes cannibalism that reduce the population size to the carrying capacity. The realization of competition/cannibalism can be purely random, and no disproportionate advantage for individuals with particular trait is needed.

Fig. 6
figure 6

Mean trait value of offspring when mean trait value of parent population is 5. The population size is three individuals. \(u=5\). See the main text for the computation method

The type of density-dependent behavioral variation found in this study can be an important driver of ecological dynamics. One way to examine the effect of the density-dependent variance of handling time on, e.g., population and community dynamics is through the functional response of predators. When a predator has a type II functional response, the realized functional response is

$$\begin{aligned} \int _{0}^{\infty }\frac{aR}{1+ahR}\,g(h)dh \end{aligned}$$
(2)

where g(h) is the probability distribution describing individual variation in handling time (e.g., it is a gamma distribution with mean \(\mu\) and variance \(\sigma ^2\) in this study). Because a type II functional response is concave up in h, ignoring the variance in h always leads to underestimation of the predation rate because of Jensen’s inequality (Okuyama 2008), and the density-dependent variance creates a new density-dependent interaction between the predator and prey even if the handling time is density-independent in expectation. Such hidden density dependence can significantly (de)stabilize communities and can only be uncovered by examining individual variation (Okuyama 2013).

Behavioral expressions have a large variance that is commonly viewed as a nuisance in the analysis of average effects. The results show that such behavioral variation is not random noise and can be an important determinant of the fitness of individual foragers. Because behavioral variation always exist in empirical data and the expression can be complex (Stamps et al. 2012; Biro and Adriaenssens 2013), understanding it is essential not only for uncovering the importance of behavioral variation itself but also for its influence as a confounding factor in any studies. For example, the mean and variance expressions are not independent, and thus one cannot fully understand mean expressions without considering how variation is expressed. Similarly, studies that focus on between-individual variation (e.g., personalities and behavioral syndrome) must be able to tease apart between- and within-individual variation (Stamps et al. 2012; Cleasby et al. 2014). Given this general importance, explicitly considering behavioral variation is likely to shed light on hidden mechanisms in a variety of biological processes.