Introduction

Elucidating the forces that have favored the evolution of advanced cognitive abilities remains central to understand some of the most elaborate behaviors found in nature, including ones that characterize our own species1. Cognition, broadly defined as the ability to acquire, process, retain and use information2, allows animals to finely tune behavior during their life time in response to rapidly changing environments, which provides an obvious fitness advantage. Its adaptive value is further supported by the typically large investment of energy and tissues in organs involved in complex cognitive tasks2,3. Nonetheless, until recently, cognitive research has focused mainly on broad evolutionary patterns, underlying mechanisms or ecological drivers of cognition and little is still known on the role of intra-specific interactions on the evolution of this fascinating trait4.

Sexual selection, a strong evolutionary force responsible for some of the most elaborate traits in nature5, has long been an obvious candidate for a selective pressure favoring advanced cognition6. A preference for cognitively superior mates could result in direct benefits as they may provide better resources for rearing offspring. If cognitive skills are heritable, as has been shown in some species7,8, indirect benefits could also be gained in the form of “good genes” for better cognitive abilities that can be passed to the offspring9. In addition, the complexity of many courtship displays, which often involve elaborated motor patterns (e.g. long song repertoires10, coordinated visual displays11) or challenging behavioral tasks (e.g. bower building in bowerbirds12), suggest they are cognitively demanding behaviors and could serve as honest indicators of cognitive abilities for mate choice or intra-sexual competition. Surprisingly, little is known on the role of sexual selection on the evolution of complex cognition.

Sexual selection favors traits that increase the reproductive output either by direct selection from the opposite sex (i.e. female choice) or by improving the access to mates through intra-sexual competition5. Cognition could provide an advantage for either of these forms of sexual selection, although most work has focused on female choice9,13. Nonetheless, evidence indicating that cognitive traits are actually favored by sexual selection is still scarce4,9. Female preference for individuals that performed better in cognitive tests has been shown in guppies (Poecilia reticulata, learning ability14), satin bowerbirds (Ptilonorhynchus violaceus15,16; but see4,13,17 for an alternative interpretation), meadow voles (Microtus pennsylvanicus18) and humans19. Evidence linking cognition and intra-sexual competition is rarer still. Performance in a problem solving task and the ability to monopolize food resources was inversely correlated in great tits (Parus major20, although the cognitive dimension of this behavior has been debated13). Primate species with stronger male-male competition have more developed brain structures involved in sensory motor skills and aggression21, which indirectly suggests that intra-sexual selection shapes cognitive traits.

The link between cognition and mating signals has been studied in more depth9. Research has focused on learned vocalizations because their cognition-mediated development potentially provides a mechanism to reliably indicate overall cognition22,23,24, but support for this link has been mixed. Male zebra finches (Taeniopygia guttata) that were more proficient at a novel foraging task had also more song elements but did not differ in the number of unique elements25. However, no link between cognitive performance and song complexity was found when sociable zebra finches were evaluated in flocks rather than individually26. Song bout length was positively correlated to spatial learning but negatively to social learning in European starlings (Sturnus vulgaris27). In song sparrows (Melospiza melodia) repertoire size was correlated to performance in a detour-reaching task28 but inversely correlated to success in color reversal28 and spatial memory tasks29. However, a third study on song sparrows that evaluated the link between performance in the same three cognitive tasks and song learning accuracy found positive correlations to color reversal and spatial learning performance but negative correlations to success in detour-reaching and novel-foraging tasks30.

Hummingbirds offer a particularly compelling group to examine the link between cognition and mating behavior31. They are among the smallest of vertebrates while employing some of the most energetically costly forms of locomotion32,33, and thus face extreme challenges in maintaining energy balance34,35. They maintain their high-energy lifestyle largely with constant access to nectar36, a resource that varies in quality over space and time37. In response they have evolved advanced cognitive abilities including fine-tuned discrimination38,39,40,41,42, detailed spatial memory, and episodic-like memory, all of which allows them to maximize foraging efficiency31,37,43. Traplining foraging (i.e. the use of flowers dispersed across the habitat in a route like fashion), exhibited by many hermit hummingbird species (subfamily Phaethornitinae), involves learning the location of inflorescences and rewarding flowers within those inflorescences across extended forest areas44. Given the high cost of flying for hummingbirds, mistakenly visiting unrewarding flowers would imply a higher energetic cost for trapliners as they visit patchy distributed flowers31, in turn suggesting selection for cognitive skills that reduce mistakes45. In addition, most hermits exhibit a lek mating system with strong male competition for mating territories46. Cognitive abilities that improve foraging efficiency could provide a key advantage for obtaining and defending lek space. Furthermore, males are well known for their active vocal signaling47, which involves advanced vocal learning skills48,49, providing a potential link between cognition and mating signals.

In this study we assessed the relation between cognitive abilities and the performance at reproductive grounds in male long-billed hermits (Phaethornis longirostris). Males form leks of 5–15 territories where they display for 6–8 hours a day for during the 8 month breeding season50, an extraordinary effort only sustained by males in good condition, resulting in an annual turnover of 48% at leks50. Songs are the primary mating signal, which they sing at a high rate throughout the day and can be learned throughout lifetime (ref.48; Video S1). In addition, the rarity and unpredictability of female visits (~1 visit per lek per day50) suggests males are under strong selection to be present, displaying and prepared to mate throughout the long mating season.

We evaluated a cognitive trait with a clear fitness value in this species, spatial learning of nectar resources. We conducted a spatial learning task on free-living hummingbirds40,41, and related its variation to both the ability to acquire and defend a lek territory (as a proxy of reproductive success) and to the structure of mating vocal signals (as a possible honest indicator of cognitive abilities). The latter association could provide an honest index signal for male-male competition and female choice22,23,24. In addition, the effect of spatial memory was contrasted to those of physical condition-related phenotypic traits such as body size, size of the bill tip (a weapon in male-male agonistic interactions), and load lifting during vertical flight (a measure of physical performance), as these represent common correlates of dominance and reproductive success5,51,52,53, particularly in lekking species54,55. Our findings indicate that spatial memory could play a key role in territory acquisition and defense, and suggest that its effect is more pronounced than those of other phenotypic traits. They also suggest male song reliably indicates spatial learning and memory in this species, further highlighting the relevance of cognitive traits in mating behavior.

Results

Spatial memory, body size and bill tip length, but not load lifting, positively predicted the probability to acquire and defend a lek territory (Figs 1 and 2; Table 1; n = 30; mean number of trials per male = 38.2 +/− 26.2 SD). The first principal component used as a proxy for body size represented 54% of the variation in morphometric parameters. All morphometric parameters had positive loadings on the first component. The single best model, which accounted for 99% of the AICc weights, also included a positive effect of load lifting, although its effect size did not differ from zero (Tables 1 and S1). The model containing spatial memory, body size and bill tip length failed to converge and was excluded from the analysis. Qualitatively equivalent results were obtained after removing juvenile males: all predictors except for load lifting contribute to predict territory ownership (Table 1). In this case two models accounted for more than 95% of the AICc weights: one including all four predictors and another one including bill tip length, spatial memory and body size. Confidence intervals overlapped for all three predictors (Fig. 1, Table S1). However, differences between effect sizes among predictors became more apparent after removing juveniles. Bill tip length, but no other predictors, correlated significantly with age (Table S3). Spatial memory scores were not affected by total number of trials, mean daily number of trials nor mean time intervals between visits (Fig. S2).

Figure 1
figure 1

Standardized effect sizes and 95 confidence intervals of functional, morphological and cognitive traits for predicting territory acquisition in lekking long-billed hermit males. Effect sizes are shown for models on the complete data set, including juveniles (n = 30, blue markers) and the one on the subset of adult males (n = 20, orange markers). Effect sizes with confidence intervals that do not overlap with zero (highlighted by the vertical dashed line) were considered to have an effect on lek territory ownership. Photo (by David McDonald) shows a long-billed hermit visiting a feeder like those used in the spatial memory test.

Figure 2
figure 2

Predicted probability of territory ownership (black line) for four phenotypic traits from adult male long-billed hermits. Observed values for territorial and floater males are shown by orange circles and diamonds, respectively and the average (+/−S.E.) values are shown in blue. The 95% confidence intervals of the probabilities are shown in gray. Body size was calculated as the first principal component from a PCA on three morphological traits: body mass, total culmen, flattened wing length and central rectrice length. The vertical dotted line on the spatial memory graph shows the spatial memory performance expected by chance (e.g. if memory is not used).

Table 1 Effect sizes and 95% confidence intervals for parameters predicting lek territory ownership and song structure in long-billed hermits. Effect sizes that did not overlap with zero are shown in bold.

Spatial memory played a more important role for territory ownership (Fig. 3). The three-dimensional surface plot with spatial memory and body size as predictors showed a rapid increase in territory ownership probability with higher spatial memory, even at small body sizes (Fig. 3a). However, the model predicted only a moderate probability increase with larger body size at low spatial memory (Fig. 3a). Both spatial memory and body size showed a stronger effect on predicting territory ownership compared to bill tip length (Fig. 3a–c), although only spatial memory reached the highest probability at the smallest bill tip length (Fig. 3b), further supporting its higher relevance in territory ownership.

Figure 3
figure 3

Three-dimensional surfaces of the predicted probability of territory ownership (z axis) for the combinations of the three traits that showed a significant effect. Probability of territory ownership was predicted based on the best mixed-effects model in the model selection procedure (two predictors at a time in the x and y axes). Values were predicted for all possible combinations of predictors (across 30 equally spaced values within the observed range) and random effect levels.

Spatial memory positively correlated with song consistency (i.e. within individual consistency) but not with song deviation (i.e. the deviation of an individual’s song from local song types) in adult territory owners (Fig. 4a,b, Table 1). The first principal component on morphological parameters used to characterize body size showed a significant negative correlation with lowest frequency (Figs 4d and 5; Table 1). Models predicting duration or mean frequency of songs did not performed better than the null (intercept-only) model (Fig. 4c and Table S1) and their effect sizes did not differ from zero (Table 1).

Figure 4
figure 4

Relationships between song structure parameters and traits affecting lek territory ownership in long-billed hermits. Each individual is represented by a single data point and colors indicate the lek of origin. Spatial memory score was positively correlated with song consistency (a) but not with deviation (b) (only two leks are shown as only those had sufficient samples to support regression lines). Body size, correlated with song lowest frequency (c) but not with song duration (d).

Figure 5
figure 5

Spectrograms of long billed hermit vocalizations for males with (a) low (mean cross-correlation: 0.66) and (b) high song consistency (mean cross-correlation: 0.86) that share the same song type. The graph shows three of the five songs with the highest signal-to-noise ratio that were used in the song consistency analysis for the two individual. Photo (by Jeremy Gatten) illustrates a territorial long-billed hermit singing on a lek perch.

Discussion

We studied the link between a cognitive ability, spatial memory, and a critical element for mating success in lekking species: the ability to acquire and defend a lek territory. We found that free living male long-billed hermits with higher cognitive performance were more likely to own lek territories and also were able to produce more consistent song, the primary signal of territory ownership. The results suggest a stronger effect of spatial memory compared to physical condition parameters traditionally associated to mating success and dominance52,53, particularly in lekking species54,55,56. Overall, our findings are consistent with a key role for cognition in mating in this species.

Spatial memory could be linked to territory ownership by three non-mutually exclusive mechanisms. The obvious one is that the higher foraging efficiency provided by spatial memory prowess allows males to spend less time foraging and more time on territorial defense. Evidence suggests that lek attendance involves important energetic costs57,58, creating an ‘endurance rivalry’5,59 in which spending more time at the lek improves territorial acquisition and reproductive output55,56. A second mechanism involves more efficient territorial defense facilitated by a better spatial memory. Lek territories in long-billed hermits are composed of several inconspicuous branches used as singing perches that are dispersed across ~150 m250. Lekking males usually interact with other territorial males at these perches, which are visited even in the absence of owners50. Hence, lekking behavior seems to require significant spatial information processing, akin to the one demanded by foraging. Alternatively, better spatial memory could enhance foraging, and thus energy intake, improving body condition, which is also important for lek territoriality. However, spatial memory did not correlate with any of the condition parameters measured (discussed below).

An alternative explanation involves an improvement in spatial memory as a result of individuals adopting cognitively demanding territorial behavior. Nonetheless, this seems unlikely given that both territorials and floaters frequently visit the territory perches from other individuals50, which suggests that both types of males face similar cognitive challenges. Furthermore, spatial memory would be expected to improve with experience in territorial behavior. If so, the observed pattern would be a by-product of the experience gained by older individuals. Only bill tip length, however, showed a significant positive correlation with age (Table S3), an expected result previously documented in this species46. Spatial memory showed a non-significant negative correlation with age (Fig. S2), indicating no improvement throughout individual’s lifetime. In addition, the direction and relative magnitude effect of predictors remained unchanged after removing juveniles (although effect size differences among predictors became more apparent), further supporting a negligible role of age.

Unsuccessful foraging visits during the return phase might have little adaptive relevance if (1) they are not due to poorer spatial memory but rather to an alternative foraging strategy or (2) if the cost of missing rewarding flowers is small. Hummingbirds tend to adopt a “switch” strategy (i.e. trying a different resource next time) only when resources are depleted60,61. However, the feeders used in our experiment represented a non-depletable resource. Given the considerable habituation period, we would expect hummingbirds to adopt a “stay learning” foraging strategy, in which coming back to the rewarding feeder provides the highest payoff. Long-billed hermits visit many different flowering plants50 covering a wide range of nectar volumes, and daily patterns of nectar production62 suggesting that a plastic foraging strategy is also expected in this species. The cost of one error in one inflorescence is probably minimal, but the cumulative cost of mistaking rewarding flowers in several flowers during several foraging trips per day, in an 8 month breeding season, could be a significant disadvantage. Furthermore, the inflorescences visited by long-billed hermits at the study site can have several hundreds of flowers62, making a “trial-an-error” strategy inefficient.

Natural selection is predicted to optimize the combination of cognitive and non-cognitive phenotypic traits63. Furthermore, several combinations could provide similar fitness outcomes. Since advanced cognitive abilities involve energetic and developmental costs, they could generate trade-offs with other fitness related traits2,3. In this study individuals that performed better in the spatial memory task did not have larger body size or weapons, suggesting that different combinations of cognitive and non-cognitive traits can lead to the same outcome: territory ownership. If true, then advanced spatial memory, large body size and big weapons could all represent alternative (although not completely independent) strategies for intra-sexual competition (e.g. several combinations of body size and spatial memory that all generate the highest probability of territory ownership as shown in Fig. 3a). This finding also indicates that low cognitive performance does not affect self-maintenance. Hence, higher cognitive performance seems to be only favored by the competitive advantage in obtaining resources critical to reproduction, further supporting the role of sexual selection in promoting advanced spatial memory.

Research on cognition and sexual selection has mostly focused on testing their putative link and little is known on the relative importance of cognitive versus other types of traits. Our study provided a direct comparison between common phenotypic targets of sexual selection and a key cognitive trait: spatial memory. Body size is a common predictor of dominance and reproductive success in birds and other taxa51,53 a pattern also found in lekking species54,55,56. Weapon size is also related to male-male dominance and access to mates64 and has been previously found to predict territory ownership in long-billed hermits46. Interestingly, our results show a stronger effect of spatial memory in territory ownership when compared to body and weapon size. A similar pattern was also observed in guppies, in which female’s mating preference was predicted by male performance at a spatial memory task but not by body size or coloration14. Further research comparing the effect of cognitive traits to other known targets of selection should provide a clearer picture of the adaptive value of cognition.

The correlation of song structure with two traits influencing territory tenure, body size and spatial memory supports the use of songs as a reliable or honest index signals of male competitive abilities. Honesty in index signals is given by physical, physiological or developmental constraints on organs directly involved in signal production22,23,24. Indeed, the negative relation between body size and vocal signal frequency is a classical example of an honest index signal24, due to its strong theoretical support65,66: low frequencies require longer and/or bigger vocal organs. This relationship is common in anurans67, although in birds it has been found mostly across species (i.e. bigger species show lower frequency vocalizations; e.g. ref.68) but rarely at the intra-specific level69,70,71. To our knowledge, the observed negative correlation between body size and lowest frequency in long-billed hermit songs provides the only known intraspecific example in a non-oscine (i.e. non-songbird) vocal learning bird.

The reliability of song consistency as an indicator of cognitive abilities might be due to shared developmental constraints9,30 or from a general positive association between cognitive traits (i.e. general intelligence9). The developmental constraint hypothesis has received significant empirical support25 but evidence remains equivocal for “general intelligence” in non-human animals13. As in songbirds and parrots, hummingbird song development is also influenced by learning48,49. Vocal learning seems to be particularly relevant in long-billed hermits as they are able to modify their songs throughout life48. In addition, the early stages of their vocal learning process are characterized by low song consistency48, suggesting a direct link between vocal learning and the song feature associated with spatial memory. Although the current evidence is insufficient to identify the mechanism enforcing honesty in these signals, our findings do show that songs encode information about a key cognitive trait on a song aspect that is clearly related to vocal learning48. Future work should focus on understanding the mechanical base of this link as well as the extent to which females make use of the information encoded by songs.

On the other hand, song deviation, which attempts to quantify vocal learning accuracy, did not correlate with spatial memory. Several causes might explain this result, including different developmental constraints, lack of “general intelligence”, or little pressure to conform with local song variants (although the existence of song neighborhoods suggests otherwise48). Alternatively, new birds might copy the song of a single individual instead of the average song of a singing neighborhood, which implies that learning accuracy should be measured as the similarity to the tutor song (a difficult proposition in wild birds). However, in this case its value as an honest signal would be unclear as females (or male opponents) would require an a priori knowledge of tutor songs, which seems unlikely given the fact that several males often share the same song type and tutors may no longer be present when a given male is singing48.

Load lifting, which reflects the power available for flight during aggressive interactions (ref.72, Video S1), was used as a measure of current physical condition. Despite elaborate flying maneuvers and chases being common in long-billed hermit territorial defense46,50, load lifting showed no detectable effect on territory ownership. This could be due to a stronger selection for long distance flying abilities in traplining species, although traplining and territorial hummingbird species do not seem to differ in their aerodynamic power (ref.73, but note that load lifting was not directly compared among the two types of species in this study). Alternatively, excess flying power could only be favored by female choice as elaborate flying displays are also used during female visitation50.

Lek territory ownership was used as a proxy for intra-sexual selection. High mating skew among territory owners due to female choice is common but not ubiquitous in lekking systems54,56. Nonetheless, it is clear that lek territoriality implies a reproductive advantage1,5,56,74, particularly in the absence of alternative strategies75. In lekking hummingbirds, territory ownership gives priority or exclusive access to females50. In addition, floaters are constantly attempting (unsuccessfully most of the time) to sing and display from perches of established territorial males, and in a few cases are able to gain control over a territory50, further supporting lek territoriality as a key resource for reproduction.

In conclusion, our findings are consistent with the longstanding idea that advanced cognitive abilities are important for mating success. Males that performed better at a spatial memory task were also more likely to be territorial, and the effect of spatial memory was more pronounced than those of physical traits generally considered important for mating success. Finally, spatial memory is reliably indicated by the structure of mating vocal signals, with males with strong spatial memory singing more consistent songs. Future work on this species should focus on the mechanisms linking cognition, territorial behavior and signaling and examine whether the same traits important in intra-sexual selection are favored by female choice.

Methods

The study was conducted at 8 leks at La Selva Biological station (10°23′N, 84°1′W), Costa Rica, in two breeding seasons between March 2013 and June 2015. Birds were captured at the leks using standard 6 and 12 m mist nets (19 mm mesh size), ringed with an individually-numbered metal band and marked with foam tags that had unique three-color combinations, attached to the back of the bird with nontoxic eyelash glue (LashGrip-Ardell76). Behavioral observations were conducted to determine territory ownership. Perches of singing males were mapped using a 20 × 20 m grid system as reference. Then, a map of lek territories based on an initial observation period was used to identify areas for further intensive netting and observations to identify all territorial males. Territorial males were defined as those able to sing at the lek and defend their singing perches from other males (as described in 50) during the observation period. Conversely, “floaters” were males observed at the lek that were unable to sing or defend their singing perches from other individuals. This is a reliable method for assessing lek territoriality that has previously provided biologically meaningful results in this system46. We have found that the lek hierarchy (floaters vs territorials) remains stable during the study period at the lek (7–15 days) as well as in the few cases when we visited the same lek in different months during the same breeding season. Furthermore, changes in territory ownership tend to occur at the start of the breeding season (Dec–Jan) which then remains stable throughout the season50 suggesting that these are consistent categories and hence can have a significant effect on reproductive output.

Morphometric measurements and sexing

We measured total culmen, flattened wing, central rectrice (i.e. tail feather), and body mass, which were used to estimate body size (see below). We also measure bill tip length, a key morphological trait for lek territory ownership in this species46 males have elongated, pointy bill tips that are used as weapons to stab opponents during aggressive interactions; territorial males have longer bill tips than floaters (ref.46, Video S1). Sex was genetically determined using a multiplex primer set that amplifies introns of the chromohelicase-DNA-binding gene that differ in size on the avian Z and W chromosomes77. Behavioral and morphological information were used to sex birds in which DNA analysis produced ambiguous results (SI).

Spatial memory test

In this study we replicated a design previously used to assess spatial memory in free-living hummingbirds38,39,40,41,42. Spatial memory was measured on free-living long-billed hermits at 3 leks. We placed 900 ml commercial hummingbird feeders (Perky Pet #209B) at 1–2 locations surrounding leks. Feeders were modified to have a single opening for accessing “nectar”. Three feeders arranged in a row (one next to the other; Video S1) were made available at a consistent location for each lek. A single feeder was filled with clear sugar water (the rewarding feeder; ~100 ml of water with 25% sucrose concentration) while the other two contained only water. The experiment trial consisted in two phases: a search phase in which visiting individuals identified the rewarding feeder and a return phase (the first visit after identifying the rewarding feeder) in which the ability to recall the position of the rewarding feeder was evaluated (Video S1). Spatial memory was tested when the position of the rewarding feeder was the same in both phases. Only the first visit after the search phase (i.e. the first return) was evaluated. Each feeder configuration lasted in average 52 min (+/−27 S.D.) and birds visited the feeders in average every 35 min (+/−9 S.D.). Performance during the return phase was coded as a binary variable (0 = fail, 1 = success) in which successful visits required visiting the rewarding feeder first. As long-billed hermits do not defend feeding territories, many individuals could be observed visiting the feeders in a short period of time, Therefore, several individuals were tested simultaneously (i.e. with the same feeder setup during the same days). The position of the rewarding feeder was changed after most visiting individuals have completed the return phase and the experiment was run until most visiting marked individuals had completed at least 10 trials. However, we also included individuals with at least 5 trials in the analyses given sample size limitations. The individual spatial memory score was calculated as the average of the performance scores (range: 0–1; 1 means perfect performance). There was considerable variation in time intervals between visits, mean number of daily trials and total number of trials. Hence, we also evaluated whether these factors influenced the spatial memory performance.

Load lifting

We determined the maximum weight that could be lifted by a hummingbird during vertical flight as a measure of current body condition (ref.72, Video S1). Load lifting measures the excess of flying power that is available for complex flights72 as the maneuvers and scape flights typical of hummingbird competitive interactions (ref.78, Video S1), including the ones employed during territorial defense in long billed hermits46. To measure load lifting we used a rubber harness connected to a nylon string placed around the neck of hummingbirds, with color beads attached along the string (Video S1). The average of the two flights with the highest load lifted was calculated for each trial as it provided the highest repeatability (SI, Fig. S2) and was then used as the load lifting score in subsequent analyses.

Song analysis

Songs were recorded for territorial males at the leks during the same field seasons in which morphological/cognitive data was collected. The song of this species is composed of a single element that is continuously repeated throughout the singing bout (i.e. single song repertoire). The five recorded songs with the highest signal-to-noise ratio were used for each individual. From 15 frequency parameters measured on songs, we selected mean frequency and lowest frequency as these parameters showed the highest repeatability within individuals (higher than 0.8; calculated using mixed-effects models on log-transformed parameters with random intercepts for individual79) and low collinearity (Pearson r = 0.18). Only crystallized songs from adult males were analyzed as sub-song from juveniles are structurally more variable48.

We assessed the accuracy of vocal learning by estimating “song deviation”: the distance of an individual’s songs to the average vocal structure of its song neighborhood (i.e. subgroup of individuals that share the same song type). Vocal structure was defined by the tridimensional acoustic space of song types from a Sammon’s mapping non-metric multidimensional scaling (using the R package “MASS”80) on spectrographic cross-correlation coefficients (after converted to distance). Song deviation was estimated as the distance between the average song structure of an individual and the centroid of the acoustic space for that particular song type (i.e. the average song structure of all other individuals in its song neighborhood). We also assessed the association between spatial memory and “song consistency”, defined as the average cross-correlation coefficient among the individual’s songs. All acoustic analyses were performed using the R packages warbleR81 and seewave82.

Statistical analyses

We used model selection on generalized linear mixed-effects models on the R packages ‘MuMIn’83 and ‘lme4’84 to determine the factors influencing territory ownership. We used Akaike Information Criteria corrected for small sample sizes (AICc) as a measure of model relative support, due to the small sample size in relation to the number of parameters. A null model of no effect was also included in each selection routine. The best model was selected as the one with the lowest AICc value that accounted for at least 95% of the AICc weights in the candidate set. If more than one model was included, then effect sizes (and 95% confidence interval) for each fixed effect were calculated using model-averaging. Effect sizes that did not overlap with zero were considered to have an effect on the response variable. Models were fitted with maximum likelihood, using a binomial error structure and a logit link function to account for the binary response variable (territorial or floater). Four predictors were included in the models: spatial memory score, load lifting, bill tip length and body size. Body size was calculated as the first axis from a principal component analysis on (within lek mean-centered85) morphometric parameters (total culmen, flattened wing, central rectrice, and body mass). Males are more likely to be floaters during their first year at leks. Hence, models for territory ownership were evaluated on a data set including adults and juveniles and on a subset including only adults. We further explore the effect of age by estimating the correlation between age and predictors affecting territory ownership using Pearson product-moment correlation coefficient (on z-score transformed variables). This approach allowed us to assess whether the observed patterns arose as a by-product of age related changes in predictors.

We further explored the relative role of traits affecting lek territoriality by estimating the probability of territory ownership predicted by the best model in the model selection procedure. The probability was obtained by predicting the response variable in our model for all possible combinations of predictors and random effect levels (i.e. leks). The joint effect of traits was graphically assessed by generating three-dimensional surface plots of the matrix of average probabilities for each combination of trait values.

We also evaluated whether traits influencing territory ownership were reflected in the structure of acoustic signals. We assessed the relation between body size on song duration and frequency as these are the most common acoustic features affected by body size (refs23,69, but see ref.70) (formant dispersion (i.e. the distribution of amplitude across the resonance frequencies of the vocal tract) has also been associated to body size86,87 but was not evaluated as long-billed hermit songs show little harmonic content). We used mixed-effect models to assess the relation between log-transformed acoustic parameters (low frequency, mean frequency, and duration) and body size. A single model selection procedure similar to those described above was run for each acoustic parameter as the response variable. The first principal component as derived in the territory ownership analysis was used as a proxy for body size (as fixed effect). The signal-to-noise ratio of each song was also included as a covariate (fixed effect). As random effects we included random intercepts for individual and lek. Only songs from adult territory owners were included in all acoustic analyses.

Additional details on field and statistical methods are provided in the supplementary information. All activities described were reviewed and authorized by the Institutional Animal Care and Use Committee at the New Mexico State University (IACUC-2011-020) and were performed under the research permits 152-2009-SINAC and 063-2011-SINAC from Costa Rican Ministerio del Ambiente y Energia, in accordance with their guidelines and regulations. Prior to the study, all subjects were captured via mist nets and handled briefly for morphometric measurement and marking with small colored tags before being released at site of capture. During the study itself the birds behaved naturally without interference from the investigators.

Data availability statement

All relevant data are provided as supporting information files.