### Dragonfly population data

We used published population monitoring data of the two *Sympetrum* species collected in Toyama^{27}, Ishikawa^{28}, and Shizuoka^{29} prefectures. Census methods differed among prefectures. In Toyama, matured adults of the two species were counted for a few tens of minutes at several hundred locations within a broad range of the prefecture during October in every year from 1993 to 2011^{27}. The data gave the number of individuals per hour within the prefecture in a month. In Ishikawa^{28} and Shizuoka^{29}, immature adults of *S. frequens* were counted at a single site in August in several years from 1989 to 2010 and from 1993 to 2009, respectively. Because the two species have a univoltine life cycle^{21,33}, the individuals observed belong to populations emerged in the same year (June–July). The data gave the number of individuals per 100 m and per hour per surveyor, respectively. To examine the association between long-term trends of summer temperature and population dynamics of the two species during the 1990s, we used the population data of these three prefectures. In regression analyses examining the relation between summer temperature and population dynamics, we used only the Toyama data, which cover 19 years, because the population data in the other prefectures were not continuous. We then used values of a parameter estimated from a regression model to project the population dynamics of *S. frequens* in Toyama.

### Temperature data calculations

As an index of summer temperature, we used the 90th percentile values of the daily mean temperature (*TEMP*) during July–August, the hottest period in Japan. Because the ancestors of *S. frequens* inhabited a cooler continental climate^{34}, we assumed that *S. frequens* is likely to suffer heat stress more seriously as the temperature increases, as do many other insects^{36}. We used the 90th percentile as the upper bound because the seasonal upper temperature is expected to be a more appropriate indicator associated with annual population growth. In addition, we used the daily mean rather than the daily maximum temperature in summer as an index of direct high-temperature damage to adult dragonflies, because a high mean reflects a longer duration of high temperature, which can cause greater heat stress in adult dragonflies, than a high momentary value. Past temperature data from a ~ 1-km^{2} grid were obtained from NARO Agro-Meteorological Grid Square Data (AMGSD)^{40}, a set of spatially interpolated data calculated from values measured by the Automated Meteorological Data Acquisition System by the Japan Meteorological Agency^{41}. We calculated spatial mean values of the 90th percentile temperature of the squares in each prefecture from 1981 to 2017. We considered it reasonable to analyse the relation between spatial mean temperature within a prefecture and abundance of both migratory *S. frequens* and non-migratory *S. infuscatum* for two reasons, both based on the fact that prefectural borders are often formed by mountain ridges. First, temperatures at different altitude (e.g., lowland and mountain) within a prefecture have a linear relationship with each other. Second, *S. frequens* appears to complete its life cycle mostly within a prefecture (i.e., matured adults stay in the mountains in summer and later return to their natal area)^{32}. For these reasons, because we used Δ*TEMP* (i.e., annual difference, not absolute value) as an index of temperature, we expected Δ*TEMP* of spatial mean values in a prefecture to correlate with those values of each species’ range.

To qualitatively analyse time trends of *TEMP* during the period of the sharp decline of *S. frequens* (i.e., from 1990 to 1999), we calculated the 10-year difference (*DIFF*), rate of change (*RATE*), and standardized difference (*STDIFF*) of *TEMP* in each prefecture during each decade of the 1980s, 1990s, and 2000s. Because annual *TEMP* fluctuated too widely to properly represent the decadal difference, we used a 5-year moving average to reduce variabilities among individual years and see long-term time trends^{42,43,44}. We calculated the difference (*DIFF*_{i,1990s}), percentage rate of change (*RATE*_{i,1990s}), and standardized difference (*STDIFF*_{i,1990s}) in prefecture *i* in the 1990s as:

$$begin{aligned} & DIFF_{i,1990s} = TEMP_{i,1999MA} {-}TEMP_{i,1990MA} & RATE_{i,1990s} = , left{ {left( {TEMP_{i,1999MA} {-}TEMP_{i,1990MA} } right) , /TEMP_{i,1990MA} } right} , times , 100 & STDIFF_{i,1990s} = DIFF_{i,1990s} /SD_{i,1990s} end{aligned}$$

where *TEMP*_{i,1999MA} and *TEMP*_{i,1990MA} are *TEMP* of the 5-year moving average (MA, 5-year mean between years *t* − 2 and *t* + 2 in year *t*) in prefecture *i* in 1999 and 1990, respectively; *SD*_{i,1990s} is the standard deviation of the annual values of *TEMP* in prefecture *i* in the 1990s; and *STDIFF* represents the long-term difference standardized to the magnitude of short-term (i.e., year-by-year) variation. We calculated these index values for each decade. Note that the starting point of the 1980s was 1983 owing to the limited availability of dragonfly data.

### Regression analyses

We examined the relations between the annual difference in *TEMP* (∆*TEMP*) and population growth rates of the two *Sympetrum* species in Toyama. We used ∆*TEMP* rather than absolute *TEMP* as a variable for reducing the temporal autocorrelation over years in the models. Our supplementary analyses showed that the models using absolute *TEMP* had no substantial difference in the main results of this study from models using ∆*TEMP* (see Supplementary Note S1). We assumed that the relationship between ∆*TEMP* and population growth can be approximated by a linear model because the range of ∆*TEMP* in the period was not too large to reject a linear approximation. We based two statistical models on the two interpretations (see “Introduction” section) of the migratory behaviour of *S. frequens*.

In interpretation 1 (the migratory behaviour avoids high temperatures in summer as an adaptation to a warmer climate^{34}), an increase in *TEMP* will increase adult mortality owing to heat stress. This implies a negative relation between *TEMP* and the abundance of a dragonfly within the same year. We constructed the following statistical model:

$$lambda_{t} = {ln}N_{t} {-}{ln}N_{{t – {1}}} = , alpha + beta Delta TEMP_{t} + , varepsilon_{t} , qquad text{(Model 1)}$$

where λ_{t} is the annual population growth rate of a dragonfly in year *t*; *N*_{t} (*N*_{t−1}) is a population density index (number of individuals/h) in year *t* (year *t − *1) recorded in October in Toyama^{27}; α is the intercept; ∆*TEMP*_{t} is the difference in *TEMP* (°C) between year *t* and year *t − *1 (∆*TEMP*_{t} = *TEMP*_{t} − *TEMP*_{t−1}); β is the coefficient; and ε_{t} is the error term in year *t*. This model implies that the same *TEMP* in year *t* and year *t − *1 (i.e., ∆*TEMP*_{t} = 0) leads to a zero growth rate when effects of other factors are negligible. We assumed that values of ε_{t} were independent between years; that is, temporal autocorrelations over years do not exist or are properly modelled in the regressions. This assumption was statistically tested by the Durbin–Watson test.

In interpretation 2 (the migratory behaviour allows *S. frequens* to overwinter in the egg stage^{37}), an increase in *TEMP* will promote earlier reproduction (i.e., disturb reproductive diapause) and increase mortality of early-emerged nymphs in winter owing to drying or low temperature. Therefore, an increase in *TEMP* should be related to the adult density in the following year. We constructed the following statistical model:

$$lambda_{t} = {ln}N_{t} {-}{ln}N_{{t – {1}}} = , alpha + beta Delta TEMP_{{t – {1}}} + , varepsilon_{t} , qquad text{(Model 2)}$$

where ∆*TEMP*_{t−1} is the difference in *TEMP* between year *t* − 1 and year *t* − 2 (∆*TEMP*_{t−1} = *TEMP*_{t−1} − *TEMP*_{t−2}).

We conducted linear regression analyses of Models 1 and 2 with both species to examine the relations between *TEMP* and density. Because the population density had nearly bottomed by 2005 in Toyama and the subsequent data are likely to consistently bias the growth rate towards an asymmetrical (i.e., increasing) trend owing to the lower bound of the density, we used only the data between 1993 and 2004 in the analyses for both species. We used R v. 3.6.1^{45} software for the analyses, and the *lmtest* package^{46} for the Durbin–Watson test. Data and R code are available in the Supplementary Materials online.

In the above models, the effects of other environmental factors that are independent of ∆*TEMP* are assumed to be included in the error term ε. If these factors are independent of ∆*TEMP*, their values will not statistically affect the consistent estimator of the regression coefficient of ∆*TEMP*. For example, many agronomic factors may affect growth rate but are expected to be independent of ∆*TEMP* (though not absolute temperature). Some other potentially non-independent environmental factors (e.g., moisture levels and UV radiation) could affect growth rate. However, because previous studies suggest that these effects were much smaller than the direct effects of temperature^{9}, we assumed that they did not have substantial influence on the consistent estimator for ∆*TEMP*. Among other environmental factors, insecticide application to rice fields can be a major cause of population declines of *S. frequens*^{30,31}. In a supplementary analysis (Supplementary Note S2), we tested the possible effects of this important factor on the estimates of the effect of ∆*TEMP* by analysing a model that added insecticide use as a covariate to the above models, using insecticide use data in Toyama Prefecture^{30}. This analysis revealed that insecticide use had no substantial influence on the results of this study.

### Projection of population densities by using regression parameter

We projected the population density of *S. frequens* in Toyama by using the value of β of the above models under the assumption that only temperature affects population dynamics. Note that the aim of this projection was to test whether the effect of temperature by itself can substantially explain the population dynamics and not to simulate realistic population dynamics by using models with various environmental parameters.

Because Model 1 performed better than Model 2 (see results of regression analyses in “Results” section), we used the β of Model 1 in the projections and assumed that *TEMP* directly affects the population density of *S. frequens* within the same year. We treated the intercept (α, a constant time trend independent of temperature) and error term (ε_{t}) as 0 in the model, and calculated the annual population growth rate of *S. frequens* (λ_{t}) in year *t* with β as:

$$lambda_{t} = {ln}N_{t} {-}{ln}N_{{t – {1}}} = , beta Delta TEMP_{t} ,$$

where *N*_{t} is population density in year *t*, and ∆*TEMP*_{t} is the difference in *TEMP* between year *t* and year *t* − 1. Note that this calculation provides a theoretical projection of population dynamics under an assumption that only temperature affects population density. For past population dynamics, we calculated population density during *S. frequens* observation period in Toyama (i.e., 1993–2011)^{27} by using the temperature data from AMGSD. We set the population density of the first year of the observation (i.e., 1993) at 1, and calculated abundance relative to the initial value in Toyama in subsequent years.

Source: Ecology - nature.com