File S1

Mathematical derivations

Identity by descent (IBD) and identity by state (IBS)

Consider the process g in the main text. As we assume that the genes under consideration are neutral, the expected allele frequency for any individual equals to that in the ancestral generation, = . As ๐น๐น is an indicator function with values 0 or 1, it further holds that = , and = 0 for ๐ธ๐ธ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๏ฟฝ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– . The probability that the alleles and in a gene j are of the same type u for the individuals i and i' is ๐ธ๐ธ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๏ฟฝ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐ธ๐ธ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– โ€ฒ ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๏ฟฝ given by . The probability that two randomly chosen alleles in a gene j are of the same type u for ๐‘ข๐‘ข โ‰  ๐‘ข๐‘ขโ€ฒ ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ the individuals i and i' is given by /4. This probability can be decomposed into two ๐ธ๐ธ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ข ๏ฟฝ , components. First, the alleles may be identical by descent, the ancestral allele being of type u. The probability โˆ‘๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ ๐ธ๐ธ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ข ๏ฟฝ of this event is . The second option is that the alleles are not identical by descent, but the alleles in the ancestral generation were both of type . As the probability of the latter event is (1 ) 2 , we obtain ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— 1 ๐‘๐‘๐‘—๐‘—๐‘—๐‘— โˆ’ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— E = + (1 ) 2 . (Eq. A1) 4 , ๏ฟฝ ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ข ๏ฟฝ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— โˆ’ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— Similarly, for , ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ

โ‰  ๐‘ข๐‘ขโ€ฒ 1 E = (1 ) . (Eq. A2) 4 , โ€ฒ ๏ฟฝ ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ขโ€ฒ ๏ฟฝ โˆ’ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐‘๐‘๐‘—๐‘— ๐‘ข๐‘ข Thus, ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ

Cov[ , ] = E 4 = 4 , , , (Eq. A3) , , โ€ฒ โ€ฒ ๏ฟฝ ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ขโ€ฒ ๏ฟฝ๏ฟฝ ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘˜๐‘˜๐‘˜๐‘˜ ๐‘ฅ๐‘ฅ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ขโ€ฒ ๏ฟฝ๏ฟฝ โˆ’ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐‘๐‘๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– โ„Ž๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ where , , = , . As we assume no linkage among the genes, it holds that Cov , โ€ฒ โ€ฒ= 0 for โ€ฒ. โ„Ž๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐›ฟ๐›ฟ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘๐‘๐‘—๐‘—๐‘—๐‘— โˆ’ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐‘๐‘๐‘—๐‘— ๐‘ข๐‘ข โ€ฒ โ€ฒ โ€ฒ โ€ฒ ๏ฟฝ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘ฅ๐‘ฅ๐‘–๐‘– ๐‘—๐‘— ๐‘˜๐‘˜ ๐‘ข๐‘ข ๏ฟฝ ๐‘—๐‘— โ‰  ๐‘—๐‘—โ€ฒ

IBD and IBS based definitions for FST, FIS and FIT

We denote by 0 the IBS probability for two alleles (same or different copy) in a randomly sampled gene j in a randomly sampled individual i in a randomly sampled subpopulation X. We denote by 1 the IBS probability for ๐‘“๐‘“ 2 SI O. Ovaskainen et al. ๐‘“๐‘“ two alleles that are obtained by sampling two individuals (same or different) from a randomly chosen subpopulation, and then sampling alleles from a randomly chosen gene j of these two individuals. We denote by 2 the IBS probability for two alleles that are obtained by randomly selecting two subpopulations (same or different), then two individuals from these, and then two alleles of the same randomly selected gene j. ๐‘“๐‘“ 2 We denote by = (1/ ) , the probability that two alleles from a randomly chosen gene j that are not identical by descent are identical by state. Note that IBS is possible when IBD does not hold although we ignore ๐œ”๐œ” ๐‘›๐‘›โ„’ โˆ‘๐‘—๐‘— ๐‘ข๐‘ข ๐‘๐‘๐‘—๐‘—๐‘—๐‘— , because multiple copies are available in the ancestral population. By Eq. A3 and the formulae for , , and (see Table I in the main text), ๐’ฎ๐’ฎ ๐œƒ๐œƒ ๐’ซ๐’ซ ๐œƒ๐œƒ ๐œƒ๐œƒ 1 1 1 1 = E = + 1 , (Eq. A4) 0 4 , โ€ฒ ๐’ฎ๐’ฎ ๐’ฎ๐’ฎ ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–๐‘–๐‘– ๐‘˜๐‘˜ ๐‘ข๐‘ข ๐‘“๐‘“ ๐’ซ๐’ซ ๏ฟฝ ๐‘‹๐‘‹ ๏ฟฝ โ„’ ๏ฟฝ ๏ฟฝ ๏ฟฝโ€ฒ ๏ฟฝ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๏ฟฝ ๐œƒ๐œƒ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐œ”๐œ” ๐‘›๐‘› 1๐‘‹๐‘‹โˆˆ๐’ซ๐’ซ ๐‘›๐‘› 1๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘›๐‘› 1๐‘—๐‘— ๐‘ข๐‘ข ๐‘˜๐‘˜1๐‘˜๐‘˜ = E = + (1 ) , (Eq. A5) 1 2 4 , , ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ข ๐‘“๐‘“ ๐’ซ๐’ซ ๏ฟฝ ๐‘‹๐‘‹ ๏ฟฝ โ„’ ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๏ฟฝ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๐œ”๐œ” 1 ๐‘›๐‘› ๐‘‹๐‘‹โˆˆ๐’ซ๐’ซ1 ๐‘›๐‘› ๐‘–๐‘– ๐‘–๐‘–โ€ฒโˆˆ๐‘‹๐‘‹ ๐‘›๐‘› 1 ๐‘—๐‘— ๐‘ข๐‘ข 1๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ = E = + 1 . (Eq. A6) 2 2 4 , , , ๐’ซ๐’ซ ๐’ซ๐’ซ ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ข ๐‘“๐‘“ ๏ฟฝ ๐‘‹๐‘‹ ๐‘Œ๐‘Œ ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๏ฟฝ ๐œƒ๐œƒ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐œ”๐œ” ๐‘›๐‘›๐’ซ๐’ซ ๐‘‹๐‘‹ ๐‘Œ๐‘Œโˆˆ๐ต๐ต ๐‘›๐‘› ๐‘›๐‘› ๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘–๐‘–โ€ฒโˆˆ๐‘Œ๐‘Œ ๐‘›๐‘›โ„’ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ We note that in the notation of COCKERHAM and WEIR (1987), 1 = 0, 2 = 1, 3 = 2. COCKERHAM and WEIR 2 2 (1987) defined 0 = 1 1 as the variance within individuals, 1 = 1 2 as the variance among individuals 2 ๐‘„๐‘„ ๐‘“๐‘“ ๐‘„๐‘„ ๐‘“๐‘“ ๐‘„๐‘„ ๐‘“๐‘“ within subpopulations, and 2 = 2 3 as the variance among subpopulations within the population. ๐œŽ๐œŽ โˆ’ ๐‘„๐‘„ ๐œŽ๐œŽ ๐‘„๐‘„ โˆ’ ๐‘„๐‘„ Defining as the ratio of subpopulation variance to the total variance, we obtain ๐œŽ๐œŽ ๐‘„๐‘„ โˆ’ ๐‘„๐‘„ ๐‘†๐‘†๐‘†๐‘† 2 ๐น๐น 2 1 2 = 2 2 2 = (Eq. A7) + + 1 2 0 ๐œŽ๐œŽ1 2 ๐‘“๐‘“ โˆ’ ๐‘“๐‘“ ๐น๐น๐‘†๐‘†๐‘†๐‘† Similarly, ๐œŽ๐œŽ ๐œŽ๐œŽ ๐œŽ๐œŽ โˆ’ ๐‘“๐‘“

0 1 0 2 = , = . 1 1 1 2 ๐‘“๐‘“ โˆ’ ๐‘“๐‘“ ๐‘“๐‘“ โˆ’ ๐‘“๐‘“ ๐น๐น๐ผ๐ผ๐ผ๐ผ ๐น๐น๐ผ๐ผ๐ผ๐ผ measure the variance among individuals relativeโˆ’ to๐‘“๐‘“ that of the subpopulationsโˆ’ ๐‘“๐‘“ or the total variance. Combining the above, we obtain the IBD-based analogues

+ (1 ) 1 (1 ) = ๐’ซ๐’ซ ๐’ซ๐’ซ = ๐’ซ๐’ซ = , (Eq. A8) 1 1 (1 )(1 ) 1 ๐’ซ๐’ซ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๐œ”๐œ” โˆ’ ๐œƒ๐œƒ โˆ’ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐œ”๐œ” ๏ฟฝ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๏ฟฝ โˆ’ ๐œ”๐œ” ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๐น๐น๐‘†๐‘†๐‘†๐‘† ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ โˆ’ ๐œƒ๐œƒ โˆ’ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐œ”๐œ” โˆ’ ๐œƒ๐œƒ โˆ’ ๐œ”๐œ” โˆ’ ๐œƒ๐œƒ = , (Eq. A9) 1๐’ฎ๐’ฎ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๐น๐น๐ผ๐ผ๐ผ๐ผ โˆ’ ๐œƒ๐œƒ

O. Ovaskainen et al. 3 SI

= . (Eq. A10) 1๐’ฎ๐’ฎ ๐’ซ๐’ซ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๐น๐น๐ผ๐ผ๐ผ๐ผ ๐’ซ๐’ซ โˆ’ ๐œƒ๐œƒ Additive genetic covariance among individuals

The covariance in the genetic value between traits m and in individuals i and is given by โ€ฒ โ€ฒ ๐‘š๐‘š ๐‘–๐‘– Cov[ , , ] = Cov , = 4 , , (Eq. A11) , , , , โ€ฒ , , โ€ฒ ๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–โ€ฒ ๐‘š๐‘šโ€ฒ ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘š๐‘šโ€ฒ ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ขโ€ฒ ๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘š๐‘šโ€ฒ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘Ž๐‘Ž ๐‘Ž๐‘Ž ๏ฟฝโ€ฒ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๏ฟฝ ๐œƒ๐œƒ ๏ฟฝโ€ฒ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ โ„Ž ๐‘—๐‘— ๐‘˜๐‘˜ ๐‘ข๐‘ข ๐‘˜๐‘˜ ๐‘ข๐‘ขโ€ฒ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข To define the matrix, we construct a hypothetical individual representing the ancestral allele frequencies. We thus let ๐’œ๐’œbe a set of random vectors (independently for each j) that follow the multinomial distribution ๐†๐† with parameters 1 and , so that E = . Let = โ€ฆ , be a random vector with = ๐‘ฅ๐‘ฅ๐‘—๐‘—๐‘—๐‘— 1, . Let be the covariance matrix with = 2 Cov[ โ„’ , ]. We have , ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๏ฟฝ๐‘ฅ๐‘ฅ๐‘—๐‘—๐‘—๐‘— ๏ฟฝ ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐›ผ๐›ผ ๏ฟฝ๐›ผ๐›ผ ๐›ผ๐›ผ๐‘›๐‘› ๏ฟฝ ๐›ผ๐›ผ๐‘š๐‘š ๐’œ๐’œ ๐’œ๐’œ โˆ‘๐‘—๐‘— ๐‘ข๐‘ข ๐‘ฅ๐‘ฅ๐‘—๐‘—๐‘—๐‘— ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐†๐† ๐บ๐บ๐‘š๐‘š๐‘š๐‘š โ€ฒ ๐›ผ๐›ผ๐‘š๐‘š ๐›ผ๐›ผ๐‘š๐‘šโ€ฒ = 2 Cov , = 2 , , (Eq. A12) ๐’œ๐’œ , , , , โ€ฒ ๐‘š๐‘š๐‘š๐‘š โ€ฒ ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—โ€ฒ๐‘š๐‘šโ€ฒ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—โ€ฒ ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—โ€ฒ๐‘š๐‘šโ€ฒ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐บ๐บ ๏ฟฝ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๏ฟฝ ๏ฟฝโ€ฒ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ โ„Ž ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ขโ€ฒ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข

Combining the above shows that

Cov[ , ] = 2 (Eq. A13) โ€ฒ โ€ฒ ๐’œ๐’œ ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘–๐‘– ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐†๐†

We may consider Eq. A14 as the definition for the matrix. depends on the allele frequencies in the ancestral population ( ) and additive values of the๐’œ๐’œ alleles ( )๐’œ๐’œ. Equivalently, as discussed above, we can ๐†๐† ๐†๐† define. by constructing a hypothetical individual i that represents the allele frequencies in the focal ๐‘๐‘๐‘—๐‘—๐‘—๐‘— ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘— population,๐’œ๐’œ i.e. by randomizing the alleles according to the allele frequencies independently for each allele ๐†๐† in each gene. This leads to = 1/2, so the interpretation that is the variance in the additive value in ๐‘๐‘๐‘—๐‘—๐‘—๐‘— such a hypothetical individual is consistent with Eq. A13. ๐’œ๐’œ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐†๐†

G in a local population

To compute for a particular population, we apply Eq. A12 with the allele frequencies corresponding to those present in that population. We denote the amount of additive variance present in ๐‘—๐‘—๐‘—๐‘—population by , ๐†๐† 1 ๐‘๐‘ and the allele frequencies present in the population by = . ( ) 2 , ๐‘‹๐‘‹ ๐†๐†๐‘‹๐‘‹ ๐‘‹๐‘‹ ๐‘๐‘ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘›๐‘›๐‘‹๐‘‹ โˆ‘๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘˜๐‘˜ ๐‘ฅ๐‘ฅ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– By the above it holds that

4 SI O. Ovaskainen et al.

, = 2 , ( ) ( ) ( ) โ€ฒ , , โ€ฒ โ€ฒ โ€ฒ โ€ฒ ๐‘‹๐‘‹๏ฟฝ๐‘š๐‘š ๐‘š๐‘š ๏ฟฝ ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘— ๐‘ข๐‘ข ๐‘š๐‘š ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘ข๐‘ข ๐†๐† ๏ฟฝโ€ฒ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ๐›ฟ๐›ฟ ๐‘๐‘ โˆ’ ๐‘๐‘ ๐‘๐‘ ๏ฟฝ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข = 2 ( ) ( ) ( ) . (Eq. A14) โ€ฒ , โ€ฒ ๏ฟฝ ๏ฟฝ๏ฟฝ ๐‘๐‘ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘— ๐‘š๐‘š โˆ’ ๏ฟฝ ๐‘๐‘ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘๐‘ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘ข๐‘ข ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘ฃ๐‘ฃ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘š๐‘šโ€ฒ ๏ฟฝ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘ข๐‘ขโ€ฒ The allele frequencies in the population and thus also depend on the realization of the process g. To compute the expectation of , we note that ๐‘‹๐‘‹ ๐†๐†๐‘‹๐‘‹ ๐น๐น ๐†๐†๐‘‹๐‘‹ 1 E[ ] = E[ ] = (Eq. A15) ( ) 2 , ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘—๐‘—๐‘— ๐‘๐‘ ๐‘‹๐‘‹ ๏ฟฝ ๐‘ฅ๐‘ฅ ๐‘๐‘ ๐‘›๐‘› ๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘˜๐‘˜ and

1 E[ ] = E[ ]. (Eq. A16) ( ) ( ) 4 2 , , , ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘–๐‘– ๐‘–๐‘–โ€ฒ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘ข๐‘ขโ€ฒ ๐‘๐‘ ๐‘๐‘ โ€ฒ ๏ฟฝ ๐‘ฅ๐‘ฅ ๐‘ฅ๐‘ฅ ๐‘›๐‘›๐‘‹๐‘‹ ๐‘–๐‘– ๐‘–๐‘– โˆˆ๐‘‹๐‘‹ ๐‘˜๐‘˜ ๐‘˜๐‘˜โ€ฒ By Eqs. A2 and A3,

1 2 2 E[ ( ) ( ) ] = 2 + (1 ) = + 1 (Eq. A17) , ๐’ซ๐’ซ ๐’ซ๐’ซ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘—๐‘—๐‘—๐‘— ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘๐‘ ๐‘๐‘ ๏ฟฝโ€ฒ ๐œƒ๐œƒ ๐‘๐‘ โˆ’ ๐œƒ๐œƒ ๐‘๐‘ ๐œƒ๐œƒ ๐‘๐‘ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐‘๐‘ ๐‘›๐‘›๐‘‹๐‘‹ ๐‘–๐‘– ๐‘–๐‘– โˆˆ๐‘‹๐‘‹ and for

๐‘ข๐‘ข โ‰  ๐‘ข๐‘ขโ€ฒ 1 E[ ( ) ( ) ] = 2 (1 ) = (1 ) . (Eq. A18) , ๐’ซ๐’ซ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘ข๐‘ขโ€ฒ ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘๐‘ ๐‘๐‘ ๏ฟฝโ€ฒ โˆ’ ๐œƒ๐œƒ ๐‘๐‘ ๐‘๐‘ โˆ’ ๐œƒ๐œƒ ๐‘๐‘ ๐‘๐‘ ๐‘›๐‘›๐‘‹๐‘‹ ๐‘–๐‘– ๐‘–๐‘– โˆˆ๐‘‹๐‘‹ Thus

E[ ( ) ( ) ] = + 1 , (Eq. A19) , ๐’ซ๐’ซ ๐’ซ๐’ซ , โ€ฒ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘š๐‘šโ€ฒ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘— ๐‘ข๐‘ข ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— โ€ฒ๐‘š๐‘šโ€ฒ ๏ฟฝ ๐‘๐‘ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๐œƒ๐œƒ ๏ฟฝ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๏ฟฝโ€ฒ ๐‘๐‘ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๐‘ข๐‘ข ๐‘ข๐‘ขโ€ฒ ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘ข๐‘ข and the expectation of is

๐†๐†๐‘‹๐‘‹

E[ ( , )] = 2 2 2 1 โ€ฒ โ€ฒ ๐’ซ๐’ซ ๐’ซ๐’ซ , โ€ฒ โ€ฒ ๐‘‹๐‘‹ ๐‘š๐‘š ๐‘š๐‘š ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— ๐‘š๐‘š ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— โ€ฒ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘— ๐‘ข๐‘ข ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘ข๐‘ข ๐‘š๐‘šโ€ฒ ๐†๐† ๏ฟฝ ๏ฟฝ๏ฟฝ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ โˆ’ ๐œƒ๐œƒ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ โˆ’ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๏ฟฝโ€ฒ ๐‘๐‘ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘ข๐‘ข = 2 1 = 1 . (Eq. A20) ๐’ซ๐’ซ โ€ฒ , โ€ฒ โ€ฒ ๐’ซ๐’ซ ๐’œ๐’œ ๐‘‹๐‘‹ ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘—๐‘—๐‘— ๐‘š๐‘š ๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘— ๐‘ข๐‘ข ๐‘—๐‘—๐‘—๐‘—๐‘—๐‘— ๐‘—๐‘— ๐‘ข๐‘ข ๐‘š๐‘šโ€ฒ ๐‘‹๐‘‹ ๐‘š๐‘š๐‘š๐‘šโ€ฒ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ โˆ’ ๏ฟฝโ€ฒ ๐‘๐‘ ๐‘๐‘ ๐‘ฃ๐‘ฃ ๐‘ฃ๐‘ฃ ๏ฟฝ ๏ฟฝ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐บ๐บ ๐‘—๐‘— ๐‘ข๐‘ข ๐‘ข๐‘ข ๐‘ข๐‘ข We note in passing that can be technically defined also for a "population" consisting of a single individual. Denoting for individual i by , we have E[ ] = (1 ) . Thus, the expected amount of additive ๐†๐† ๐’œ๐’œ ๐†๐† ๐†๐†๐‘–๐‘– ๐†๐†๐‘–๐‘– โˆ’ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐†๐† O. Ovaskainen et al. 5 SI variation present in a local population represented by a single non-inbred individual ( = 1/2) is half of the additive variation that is present in the ancestral population. ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘–

Additive genetic variation among populations

The additive variance-covariance among the populations is a random variable over the process g, and we next compute its expectation. We have ๐ƒ๐ƒ ๐น๐น 1 1 Cov , = Cov[ , ] = 2 = 2 , (Eq. A21) ๐’ซ๐’ซ ๐’ซ๐’ซ , , ๐’œ๐’œ ๐’ซ๐’ซ ๐’œ๐’œ ๐‘‹๐‘‹ ๐‘Œ๐‘Œ ๐‘–๐‘– ๐‘—๐‘— ๐‘–๐‘–๐‘–๐‘– ๐‘‹๐‘‹๐‘‹๐‘‹ ๏ฟฝ๐’‚๐’‚ ๐’‚๐’‚ ๏ฟฝ ๐‘‹๐‘‹ ๐‘‹๐‘‹ ๏ฟฝ ๐’‚๐’‚ ๐’‚๐’‚ ๐‘‹๐‘‹ ๐‘Œ๐‘Œ ๏ฟฝ ๐œƒ๐œƒ ๐†๐† ๐œƒ๐œƒ ๐†๐† ๐‘›๐‘› ๐‘›๐‘› ๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘—๐‘— โˆˆ๐‘Œ๐‘Œ1 ๐‘›๐‘› ๐‘›๐‘› ๐‘–๐‘–โˆˆ๐‘‹๐‘‹2๐‘—๐‘— โˆˆ๐‘Œ๐‘Œ Cov , = Cov , = , (Eq. A22) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๐‘‹๐‘‹ ๐‘‹๐‘‹ ๐‘Œ๐‘Œ ๐‘‹๐‘‹๐‘‹๐‘‹ ๏ฟฝ๐’‚๐’‚ ๐’‚๐’‚ ๏ฟฝ ๐’ซ๐’ซ ๏ฟฝ ๏ฟฝ๐’‚๐’‚ ๐’‚๐’‚ ๏ฟฝ ๐’ซ๐’ซ ๏ฟฝ ๐œƒ๐œƒ ๐†๐† 1 ๐‘›๐‘› ๐‘Œ๐‘Œโˆˆ๐’ซ๐’ซ 2 ๐‘›๐‘› ๐‘Œ๐‘Œโˆˆ๐’ซ๐’ซ Var = Cov[ , ] = 2 = 2 . (Eq. A23) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ , ๐’ซ๐’ซ ๐’œ๐’œ ๐’ซ๐’ซ ๐’œ๐’œ ๐‘‹๐‘‹ ๐‘‹๐‘‹๐‘‹๐‘‹ ๏ฟฝ๐’‚๐’‚ ๏ฟฝ ๐’ซ๐’ซ ๏ฟฝ ๐’‚๐’‚ ๐’‚๐’‚ ๏ฟฝ ๐œƒ๐œƒ ๐†๐† ๐œƒ๐œƒ ๐†๐† ๐‘›๐‘› ๐‘‹๐‘‹โˆˆ๐’ซ๐’ซ ๐‘›๐‘›๐’ซ๐’ซ ๐‘‹๐‘‹ ๐‘Œ๐‘Œโˆˆ๐’ซ๐’ซ As the expectation of additive value is the same for each individual (and thus for and for ), it holds that ๐’ซ๐’ซ ๐’ซ๐’ซ 1 1 ๐’‚๐’‚4๐‘‹๐‘‹ ๐’‚๐’‚ [ ] = Var 2Cov[ , ] + Var = 2 + 2 ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๐‘‹๐‘‹ ๐‘‹๐‘‹ ๐‘‹๐‘‹ ๐‘‹๐‘‹๐‘‹๐‘‹ ๐ธ๐ธ ๐ƒ๐ƒ ๐’ซ๐’ซ ๏ฟฝ๏ฟฝ ๏ฟฝ๐’‚๐’‚ ๏ฟฝ โˆ’ ๐’‚๐’‚ ๐’‚๐’‚ ๏ฟฝ๐’‚๐’‚ ๏ฟฝ๏ฟฝ ๐’ซ๐’ซ ๏ฟฝ ๏ฟฝ ๐œƒ๐œƒ โˆ’ ๐’ซ๐’ซ ๏ฟฝ ๐œƒ๐œƒ ๐œƒ๐œƒ ๏ฟฝ ๐†๐† ๐‘›๐‘› ๐‘‹๐‘‹โˆˆ๐’ซ๐’ซ = 2 . (Eq. A24) ๐‘›๐‘› ๐‘‹๐‘‹โˆˆ๐’ซ๐’ซ ๐‘›๐‘› ๐‘Œ๐‘Œโˆˆ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๏ฟฝ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๏ฟฝ๐†๐† Covariance structure of breeding experiment data

The four random processes ( g , gโ€ฒ, s, e) described in the main text are disjoint, so that each of them can be applied in isolation or in combination with the others. We denote expectations (and related variances and ๐น๐น ๐น๐น ๐น๐น ๐น๐น covariances) over combinations of these random processes by listing the processes over which the expectations are taking in the subscript, e.g. Cov(s,e)[ ]. When an expectation is taken over some of the random processes while others are kept at a fixed realization, the result is conditional on the realizations kept โˆ™ fixed.

We assume that the environmental effects are independent between individuals, and are independent of additive genetic effects. This gives Cov(e) , = E, where E denotes the environmental covariance matrix. The definition in left-hand side is conditional on the realizations of the processes , , , but in this ๏ฟฝ๐’†๐’†๐‘–๐‘– ๐’†๐’†๐‘—๐‘— ๏ฟฝ ๐›ฟ๐›ฟ๐‘–๐‘–๐‘–๐‘– ๐•๐• ๐•๐• g gโ€ฒ s case the result in the right-hand side of is independent of these realizations. Similarly, we have Cov , = ๐น๐น ๐น๐น ๐น๐น(g) Cov , = Cov , = 0. (g ) (s) ๏ฟฝ๐’‚๐’‚๐’Š๐’Š ๐’†๐’†๐’‹๐’‹๏ฟฝ

โ€ฒ ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’†๐’†๐‘—๐‘— ๏ฟฝ ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’†๐’†๐‘—๐‘— ๏ฟฝ

6 SI O. Ovaskainen et al.

To proceed, we need to introduce some more notation. We denote co-ancestry coefficients for individual- 1 1 population pairs as = , so that = . We denote by s( ) and d( ) the sire and the ๐’พ๐’พ๐’พ๐’พ ๐’ซ๐’ซ ๐’พ๐’พ๐’พ๐’พ ๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘— โˆˆ๐‘Œ๐‘Œ ๐‘–๐‘–๐‘–๐‘– ( ( ๐‘–๐‘–โˆˆ๐‘‹๐‘‹ ๐‘–๐‘–๐‘–๐‘– dam of the individual๐œƒ๐œƒ i, and๐‘›๐‘› ๐‘Œ๐‘Œrecallโˆ‘ that๐œƒ๐œƒ ) and๐œƒ๐œƒ ๐‘‹๐‘‹๐‘‹๐‘‹ ) denote๐‘›๐‘›๐‘‹๐‘‹ โˆ‘ the๐œƒ๐œƒ local populations from๐‘–๐‘– which๐‘–๐‘– the sire and the dam of the individual i originate. ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘–

As shown by Eq. A13, the covariance among genetic effects for a pair of individuals is given by

Cov(g,g ) , = 2 , where i and j refer to any individuals in the field populations or the laboratory populationโ€ฒ . Thus, utilizing๐’œ๐’œ the recursive formula for coancestry coefficients, 2 = + , we obtain ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐†๐† ( ) ( ) for laboratory individuals i and j ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘—๐‘—

1 1 Cov g,g , = Cov g,g [ , ] + Cov g,g [ , ] 2 ( ) 2 ( ) โ€ฒ ( ) โ€ฒ ( ) โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘—โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘—โ€ฒ ๏ฟฝ๐’‚๐’‚ ๐’‘๐’‘ ๏ฟฝ 1๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐’‚๐’‚ ๐’‚๐’‚1 ๐ท๐ท ๐‘—๐‘— ๏ฟฝ ๐’‚๐’‚ ๐’‚๐’‚ = ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— 2 + ๐‘›๐‘› 2 ๐‘—๐‘—โ€ฒโˆˆ๐ท๐ท ๐‘—๐‘— 2 ( ) 2 ( ) ( ) ๐’œ๐’œ ( ) ๐’œ๐’œ ๐‘–๐‘–๐‘–๐‘–โ€ฒ ๐‘–๐‘–๐‘–๐‘–โ€ฒ 1๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐†๐† ๐ท๐ท ๐‘—๐‘— ๏ฟฝ 1๐œƒ๐œƒ ๐‘ฎ๐‘ฎ ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐ท๐ท ๐‘—๐‘— = [ ( ) + ( ) ] + [ ( ) + ( ) ] 2 ( ) 2 ( ) ( ) โ€ฒ โ€ฒ ๐’œ๐’œ ( ) โ€ฒ โ€ฒ ๐’œ๐’œ ๐‘ ๐‘  ๐‘–๐‘– ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘—๐‘— ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐œƒ๐œƒ ๐†๐† ๐ท๐ท ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐œƒ๐œƒ ๐†๐† ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐ท๐ท ๐‘—๐‘— = + + + . (Eq. A25) 2๐’œ๐’œ ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐†๐† ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๏ฟฝ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ For the field individual iโ€™ and lab-individual j, it holds that

1 1 Cov g,g , = Cov g,g [ , ] + Cov g,g [ , ] 2 ( ) 2 ( ) โ€ฒ ( ) โ€ฒ ( ) โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘–โ€ฒ ๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๐‘–๐‘–โ€ฒ ๐‘—๐‘—โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘–โ€ฒ ๐‘—๐‘—โ€ฒ ๏ฟฝ๐’‚๐’‚ ๐’‘๐’‘ ๏ฟฝ 1 ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐’‚๐’‚1 ๐’‚๐’‚ ๐ท๐ท ๐‘—๐‘— ๏ฟฝ ๐’‚๐’‚ ๐’‚๐’‚ ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐ท๐ท ๐‘—๐‘— = + = ( ) + ( ) . (Eq. A26) ( ) ( ) ( ) ๐’œ๐’œ ( ) ๐’œ๐’œ ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’œ๐’œ ๐‘–๐‘–โ€ฒ๐‘—๐‘—โ€ฒ ๐‘–๐‘–โ€ฒ๐‘—๐‘—โ€ฒ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐†๐† ๐ท๐ท ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐†๐† ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ ๏ฟฝ ๐†๐† ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐ท๐ท ๐‘—๐‘— Thus, we obtain for the laboratory individuals i and j

1 1 Cov g,g , = Cov g,g , + Cov g,g , 2 ( ) 2 ( ) โ€ฒ ( ) โ€ฒ โ€ฒ ( ) โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘— ๏ฟฝ๐’‘๐’‘ ๐’‘๐’‘ ๏ฟฝ 1๐‘†๐‘† ๐‘–๐‘– โ€ฒ๏ฟฝ ๏ฟฝ๐’‚๐’‚ ๐’‘๐’‘ ๏ฟฝ ๐ท๐ท ๐‘–๐‘– 1โ€ฒ ๏ฟฝ ๏ฟฝ๐’‚๐’‚ ๐’‘๐’‘ ๏ฟฝ ๐‘›๐‘› ๐‘–๐‘– โˆˆ๐‘†๐‘† ๐‘–๐‘– ๐‘›๐‘› ๐‘–๐‘– โˆˆ๐ท๐ท ๐‘–๐‘– = ( ) + ( ) + ( ) + ( ) 2 ( ) 2 ( ) ( ) ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’œ๐’œ ( ) ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’พ๐’พโ€ฒ๐’พ๐’พ ๐’œ๐’œ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— 1 ๐‘†๐‘† ๐‘–๐‘– โ€ฒ๏ฟฝ ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ ๏ฟฝ ๐†๐† ๐ท๐ท ๐‘–๐‘– โ€ฒ ๏ฟฝ ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ ๏ฟฝ ๐†๐† = ๐‘›๐‘› ๐‘–๐‘– โˆˆ๐‘†๐‘† ๐‘–๐‘–+ + + ๐‘›๐‘› ๐‘–๐‘– โˆˆ๐ท๐ท ๐‘–๐‘–. (Eq. A27) 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† Combining the above, for lab-individuals i and j it further holds that

O. Ovaskainen et al. 7 SI

Cov g,g , = Cov g,g , Cov g,g , โ€ฒ 1 โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’”๐’”๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ= ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚+๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ โˆ’ +๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘+๐‘—๐‘— ๏ฟฝ 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’œ๐’œ 1 ๐‘ ๐‘  ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐œƒ๐œƒ + ๐œƒ๐œƒ + ๐œƒ๐œƒ + ๐œƒ๐œƒ ๏ฟฝ๐†๐† (Eq. A28) 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ โˆ’ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† and that

Cov g,g , = Cov g,g , โ€ฒ = Cov โ€ฒ , Cov , Cov , + Cov , ๏ฟฝ ๏ฟฝ๏ฟฝ๐’”๐’”๐‘–๐‘– ๐’”๐’”๐‘—๐‘— ๏ฟฝ ๏ฟฝg,g ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– โˆ’ ๐’‘๐’‘๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— โˆ’ ๐’‘๐’‘g,๐‘—๐‘—g๏ฟฝ g,g g,g 1 โ€ฒ 1 โ€ฒ โ€ฒ โ€ฒ = ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ โˆ’ +๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘—+๏ฟฝ โˆ’ ๏ฟฝ +๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ 2 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) 1 ๐’œ๐’œ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’œ๐’œ ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐†๐† โˆ’+๏ฟฝ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— + ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— + ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’œ๐’œ 1 ๐‘ ๐‘  ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– +โˆ’ ๏ฟฝ๐œƒ๐œƒ + ๐œƒ๐œƒ + ๐œƒ๐œƒ +๐œƒ๐œƒ ๏ฟฝ๐†๐† . (Eq. A29) 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† We next treat the randomness associated to sampling individuals from the field populations to form the parental generation for the laboratory population. As we assume that the individuals used in the breeding design are a random sample from the field populations, we obtain for laboratory individuals i and j 1 1 E( ) ( ) ( ) = E( ) ( ) โ€ฒ = โ€ฒ โ€ฒ = ( ) ( ) (Eq. A30) ( ) ( ) ( ) ๐’พ๐’พ๐’พ๐’พ ( ) ( ), ( ) ๐’ซ๐’ซ ๐‘ ๐‘  ๐‘ ๐‘  ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘ ๐‘  ๐‘ ๐‘  ๐‘–๐‘– ๐‘—๐‘— ๐‘–๐‘– ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ๐œƒ๐œƒ ๏ฟฝ ๏ฟฝ ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๏ฟฝ ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๏ฟฝ ๐œƒ๐œƒ ๐œƒ๐œƒ ๐‘›๐‘› ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— ๐‘›๐‘› ๐‘›๐‘› ๐‘–๐‘–โ€ฒโˆˆ๐‘†๐‘† ๐‘–๐‘– ๐‘—๐‘—โ€ฒโˆˆ๐‘†๐‘† ๐‘—๐‘— Similarly,

E( ) ( ) ( ) = ( ) ( ), E( ) ( ) ( ) = ( ) ( ), E( ) ( ) ( ) = ( ) ( ). (Eq. A31) ๐’พ๐’พ๐’พ๐’พ ๐’ซ๐’ซ ๐’พ๐’พ๐’พ๐’พ ๐’ซ๐’ซ ๐’พ๐’พ๐’พ๐’พ ๐’ซ๐’ซ ๐‘ ๐‘  ๐‘ ๐‘  ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘ ๐‘  ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘ ๐‘  ๐‘‘๐‘‘ ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— The expected๏ฟฝ๐œƒ๐œƒ sire-๏ฟฝdam๐œƒ๐œƒ and dam-sire coancestry๏ฟฝ๐œƒ๐œƒ coefficients๏ฟฝ ๐œƒ๐œƒ are given ๏ฟฝby๐œƒ๐œƒ ๏ฟฝ ๐œƒ๐œƒ

E( ) ( ) ( ) = ( ) ( ), E( ) ( ) ( ) = ( ) ( ). (Eq. A32) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐‘ ๐‘  ๐‘ ๐‘  ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐‘ ๐‘  ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— In case of sire-sire (or dam๏ฟฝ๐œƒ๐œƒ -dam)๏ฟฝ combinations,๐œƒ๐œƒ the two๏ฟฝ๐œƒ๐œƒ sires (dams)๏ฟฝ ๐œƒ๐œƒ may represent the same individual or different individuals. Whether they represent the same or different individuals is part of the study design and thus independent of the sampling process, giving

( ) ( ) ( ) ( ) E( ) ( ) ( ) = (Eq. A33) ๐’ซ๐’ซ ( ) = ( ), ๐œƒ๐œƒ๐‘†๐‘†(๐‘–๐‘–)๐‘†๐‘† ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– โ‰  ๐‘ ๐‘  ๐‘—๐‘— and ๐‘ ๐‘  ๏ฟฝ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๐’ฎ๐’ฎ ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘ ๐‘  ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ( ) ( ) ( ) ( ) E( ) ( ) ( ) = (Eq. A34) ๐’ซ๐’ซ ( ) = ( ). ๐œƒ๐œƒ๐ท๐ท(๐‘–๐‘–)๐ท๐ท ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– โ‰  ๐‘‘๐‘‘ ๐‘—๐‘— ๐‘ ๐‘  ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— As ๏ฟฝ๐œƒ๐œƒ ๏ฟฝ ๏ฟฝ ๐’ฎ๐’ฎ ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘—

8 SI O. Ovaskainen et al.

1 1 + , = 2 2 ( ) ( ) = (Eq. A35) 1 ๐‘ ๐‘  ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ( ) ( ) + ( ) ( )๐œƒ๐œƒ+ ( ) ( )๐‘–๐‘–+ ๐‘—๐‘— ( ) ( ) , , ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๏ฟฝ4 ๏ฟฝ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐œƒ๐œƒ๐‘ ๐‘  ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐œƒ๐œƒ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘— we obtain

1 1 + = 2 2 ( ) ( ) 1 ๐’ซ๐’ซ โŽง +๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– + + ๐‘–๐‘– ๐‘—๐‘— , ( ) ( ), ( ) ( ) 4 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) โŽช ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ โŽช1 ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— E( )[ ] = โŽช ๏ฟฝ๐œƒ๐œƒ ( ) + ( ๐œƒ๐œƒ) ( ) + ( ๐œƒ๐œƒ) ( ) + ( ๐œƒ๐œƒ) ( ) ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘—,๐‘ ๐‘ (๐‘–๐‘–) โ‰ = ๐‘ ๐‘ (๐‘—๐‘—),๐‘‘๐‘‘(๐‘–๐‘–) โ‰  ๐‘‘๐‘‘(๐‘—๐‘—) (Eq. A36) โŽช4 ๐’ฎ๐’ฎ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐‘ ๐‘  ๐‘–๐‘–๐‘–๐‘– 1 ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ+ ๐œƒ๐œƒ+ ๐œƒ๐œƒ+ ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘—, ๐‘ ๐‘ (๐‘–๐‘–) ๐‘ ๐‘ (๐‘—๐‘—), ๐‘‘๐‘‘(๐‘–๐‘–) =โ‰  ๐‘‘๐‘‘(๐‘—๐‘—) โŽจ4 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ฎ๐’ฎ โŽช1 ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– โŽช ๏ฟฝ๐œƒ๐œƒ ( ) + ( ๐œƒ๐œƒ) ( ) + (๐œƒ๐œƒ) ( ) + (๐œƒ๐œƒ) ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘—,๐‘ ๐‘ (๐‘–๐‘–) โ‰ = ๐‘ ๐‘ (๐‘—๐‘—),๐‘‘๐‘‘(๐‘–๐‘–) = ๐‘‘๐‘‘(๐‘—๐‘—) โŽช4 ๐’ฎ๐’ฎ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ฎ๐’ฎ โŽช ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐ท๐ท ๐‘–๐‘– โŽฉ ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ ๐œƒ๐œƒ ๐œƒ๐œƒ ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘— We next are now ready to extend the covariances over (g, g ) to covariances over (g, g , s). Since the sampling โ€ฒ โ€ฒ process s is independent of the processes g and gโ€ฒ, it holds for any random variables and ,

๐น๐น ๐น๐น ๐น๐น ๐ด๐ด ๐ต๐ต

Cov g,g ,s [ , ] = E g,g ,s [ ] E g,g ,s [ ]E g,g ,s [ ] โ€ฒ โ€ฒ โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ ๐ด๐ด ๐ต๐ต = E(๏ฟฝs) E ๏ฟฝg,๐ด๐ดg ๐ด๐ด[ โˆ’] ๏ฟฝ E g๏ฟฝ,g ๐ด๐ด[ ๏ฟฝ]E g,g๏ฟฝ ๐ต๐ต[ ] + E(s) E g,g [ ]E g,g [ ] E g,g ,s [ ]E g,g ,s [ ] โ€ฒ โ€ฒ โ€ฒ โ€ฒ โ€ฒ โ€ฒ โ€ฒ = E(s) ๏ฟฝCov๏ฟฝ g๏ฟฝ,g๐ด๐ด๐ด๐ด( ,โˆ’) ๏ฟฝ+ E๏ฟฝ(s๐ด๐ด) E๏ฟฝ g,g ๏ฟฝ [๐ต๐ต]๏ฟฝE g,g [ ๏ฟฝ] ๏ฟฝ E๏ฟฝ g๐ด๐ด,g ,s๏ฟฝ [ ]๏ฟฝE๐ต๐ตg,g๏ฟฝ โˆ’,s [ ๏ฟฝ] (Eq๏ฟฝ ๐ด๐ด. A37๏ฟฝ ) ๏ฟฝ ๐ต๐ต โ€ฒ โ€ฒ โ€ฒ โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ ๏ฟฝ ๐ด๐ด ๐ต๐ต ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ ๐ด๐ด ๏ฟฝ ๏ฟฝ ๐ต๐ต ๏ฟฝ โˆ’ ๏ฟฝ ๏ฟฝ ๐ด๐ด ๏ฟฝ ๏ฟฝ ๐ต๐ต For any realization of the process s and any laboratory individual i,

๐น๐น

E g,g [ ] = E g,g [ ] = E g,g [ ] = 0, (Eq. A38) โ€ฒ โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๏ฟฝ ๏ฟฝ ๐‘–๐‘– ๏ฟฝ ๏ฟฝ ๐‘–๐‘– and thus, for any laboratory individuals๐’‚๐’‚ i and j, ๐’‘๐’‘ ๐’”๐’”

1 Cov , = E Cov , = + + + , (Eq. A39) g,g ,s (s) g,g 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) โ€ฒ โ€ฒ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ๏ฟฝ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† Cov g,g ,s , = E(s) Cov g,g , = E(s) ( ) + ( ) โ€ฒ 1 โ€ฒ ๐’พ๐’พ๐’พ๐’พ ๐’พ๐’พ๐’พ๐’พ ๐’œ๐’œ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘—=๏ฟฝ ๏ฟฝ ๏ฟฝ+ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘—+๏ฟฝ๏ฟฝ ๏ฟฝ๐œƒ๐œƒ+๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘— ๐œƒ๐œƒ๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘— ๏ฟฝ๐†๐† = Cov , , (Eq. A40) 2 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) g,g ,s ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’ซ๐’ซ ๐’œ๐’œ โ€ฒ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘—๐‘— ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘—๐‘— ๏ฟฝ๐†๐† ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ Cov g,g ,s , = Cov g,g ,s , = 0, (Eq. A41) โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’”๐’”๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– โˆ’ ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ Cov g,g ,s , = E(s) Cov g,g , = 2E(s) ij , (Eq. A42) โ€ฒ โ€ฒ ๐’œ๐’œ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ๏ฟฝ ๏ฟฝ๐œƒ๐œƒ ๏ฟฝ๐†๐†

O. Ovaskainen et al. 9 SI and thus

Cov g,g ,s , = Cov g,g ,s , = Cov g,g ,s , Cov g,g ,s , โ€ฒ = 2 โ€ฒ (Eq. A43) โ€ฒ โ€ฒ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’”๐’”๐‘–๐‘– ๐’”๐’”๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– โˆ’ ๐’‘๐’‘๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— โˆ’ ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‚๐’‚๐‘–๐‘– ๐’‚๐’‚๐‘—๐‘— ๏ฟฝ โˆ’ ๏ฟฝ ๏ฟฝ๏ฟฝ๐’‘๐’‘๐‘–๐‘– ๐’‘๐’‘๐‘—๐‘— ๏ฟฝ ๐’œ๐’œ ๐‘“๐‘“๐‘–๐‘–๐‘–๐‘– ๐†๐† where 1 1 + = 2 4 ( ) ( ) ( ) ( ) 0 ๐’ซ๐’ซ ๐’ซ๐’ซ , ( ) ( ), ( ) ( ) โŽง โˆ’ ๏ฟฝ๐œƒ๐œƒ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– ๏ฟฝ ๐‘–๐‘– ๐‘—๐‘— 1 โŽช , ( ) = ( ), ( ) ( ) = โŽช 4 ( ) ( ) ( ) ๐‘–๐‘– โ‰  ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– โ‰  ๐‘ ๐‘  ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– โ‰  ๐‘‘๐‘‘ ๐‘—๐‘— (Eq. A44) โŽช ๐’ฎ๐’ฎ ๐’ซ๐’ซ 1 ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐‘–๐‘–๐‘–๐‘– ๏ฟฝ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘— ,๐‘ ๐‘  (๐‘–๐‘– ) ๐‘ ๐‘  (๐‘—๐‘— ),๐‘‘๐‘‘ (๐‘–๐‘– )โ‰ =๐‘‘๐‘‘ (๐‘—๐‘— ) ๐‘“๐‘“ 4 ( ) ( ) ( ) โŽจ1 ๐’ฎ๐’ฎ ๐’ซ๐’ซ โŽช ๏ฟฝ๐œƒ๐œƒ๐ท๐ท+๐‘–๐‘– โˆ’ ๐œƒ๐œƒ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘—,๐‘ ๐‘ (๐‘–๐‘–) โ‰ = ๐‘ ๐‘ (๐‘—๐‘—),๐‘‘๐‘‘(๐‘–๐‘–) = ๐‘‘๐‘‘(๐‘—๐‘—) โŽช4 ( ) ( ) ( ) ( ) ( ) ( ) ๐’ฎ๐’ฎ ๐’ฎ๐’ฎ ๐’ซ๐’ซ ๐’ซ๐’ซ โŽช ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐‘†๐‘† ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– ๐ท๐ท ๐‘–๐‘– โŽฉ ๏ฟฝ๐œƒ๐œƒ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ โˆ’ ๐œƒ๐œƒ ๏ฟฝ ๐‘–๐‘– โ‰  ๐‘—๐‘— ๐‘ ๐‘  ๐‘–๐‘– ๐‘ ๐‘  ๐‘—๐‘— ๐‘‘๐‘‘ ๐‘–๐‘– ๐‘‘๐‘‘ ๐‘—๐‘—

References

COCKERHAM, C. C., and B. S. WEIR, 1987 Correlations, descent measures - drift with migration and mutation. Proceedings of the National Academy of Sciences of the United States of America 84: 8512-8514.

10 SI O. Ovaskainen et al.

File S2

Parameter estimation

Given neutral molecular data and the breeding experiment data, we fitted a neutral model to the data using Bayesian inference, and then tested for deviation from neutrality using the approach described in the main paper. Here we describe the statistical model, the prior distributions and a Markov Chain Monte Carlo (MCMC) method that was used to parameterize the model.

The statistical model for neutral molecular markers

We model the neutral divergence of the local populations from a common ancestral population as a mixture of independent lineages. The model summarized in this section will be published later in ๐‘›๐‘›๐’ซ๐’ซ more detail (KARHUNEN and OVASKAINEN 2011). ๐‘›๐‘›โ„’ The allele frequencies in locus in lineage are distributed as

๐‘—๐‘— ๐‘˜๐‘˜~Dirichlet .

๐‘˜๐‘˜๐‘˜๐‘˜ ๐‘˜๐‘˜ ๐‘—๐‘— where denotes the vector of allele frequencies๐’›๐’› in the๏ฟฝ๐‘Ž๐‘Ž ancestral๐’’๐’’ ๏ฟฝ population, and measures the amount of drift experienced by lineage . The allele frequencies in locus in local population are ๐’’๐’’๐‘—๐‘— ๐‘Ž๐‘Ž๐‘˜๐‘˜ defined as a mixture of the lineage-specific frequencies, ๐‘˜๐‘˜ ๐‘—๐‘— ๐ด๐ด = . ๐ฟ๐ฟ ๐‘›๐‘›=1 ๐ด๐ด ๐ด๐ด ๐‘—๐‘— ๐‘˜๐‘˜ ๐‘˜๐‘˜๐‘˜๐‘˜ ๐’‘๐’‘ ๏ฟฝ๐‘˜๐‘˜ ๐œ…๐œ… ๐’›๐’› Here, we assume that the mixture weights sum up to unity over the lineages, =1 = 1, so ๐ฟ๐ฟ that vector is a proper frequency distribution.๐ด๐ด The genotype (in terms of the neutral๐‘›๐‘› marker๐ด๐ด loci) ๐œ…๐œ…๐‘˜๐‘˜ โˆ‘๐‘˜๐‘˜ ๐œ…๐œ…๐‘˜๐‘˜ of each individual๐ด๐ด in a population is a multinomial random variable of the allele frequencies, ๐’‘๐’‘๐‘—๐‘— ~Multinomial 2, . . ๐ด๐ด ๐ด๐ด ๐‘–๐‘–๐‘–๐‘– ๐‘—๐‘— ๐‘ฅ๐‘ฅThe population-population๏ฟฝ ๐’‘๐’‘ ๏ฟฝ coancestry coefficients depend on the model parameters as

= . ๐ฟ๐ฟ ๐ด๐ด ๐ต๐ต ๐‘›๐‘›=1 + 1 ๐’ซ๐’ซ ๐œ…๐œ…๐‘˜๐‘˜ ๐œ…๐œ…๐‘˜๐‘˜ ๐œƒ๐œƒ๐ด๐ด๐ด๐ด ๏ฟฝ Note that is defined through probability of IBD๐‘˜๐‘˜ for ๐‘Ž๐‘Žneutral๐‘˜๐‘˜ loci, and thus, it does not depend on allele frequencies๐’ซ๐’ซ in the ancestral generation. ๐œƒ๐œƒ๐ด๐ด๐ด๐ด ๐’’๐’’๐‘—๐‘—

O. Ovaskainen et al. 11 SI

The Directed Acyclic Graph (DAG) that describes the dependencies among model variables (including both neutral marker data and quantitative trait data) is shown in Supplementary Figure 1. While the framework develop in the paper and presented in the DAG allows for the inclusion of an arbitrary level of ( ), we did not account for inbreeding in the present estimation scheme and thus ๐’ฎ๐’ฎ assumed = 0.5(1 ๐‘‹๐‘‹+ ). ๐’ฎ๐’ฎ ๐œƒ๐œƒ ๐’ซ๐’ซ ๐œƒ๐œƒ๐‘‹๐‘‹ ๐œƒ๐œƒ๐‘‹๐‘‹ Prior distributions

To parameterize the model with Bayesian inference, prior distributions need to be defined for the primary parameters of the model: , , E , , and . We assume the priors ๐’œ๐’œ ๐๐ ๐†๐† ๐•๐• ๐’’๐’’~๐’‚๐’‚N(0,100๐œฟ๐œฟ ),

~Wishart๐œ‡๐œ‡๐‘š๐‘š( ( + 1) 1, + 1), ๐’œ๐’œ โˆ’ ๐‘š๐‘š 1 ๐†๐†E~Wishart( ๐ˆ๐ˆ ( ๐‘š๐‘š+ 1) , ๐‘š๐‘š+ 1), โˆ’ ๐•๐• ~Dirichlet๐ˆ๐ˆ๐‘š๐‘š ๐‘š๐‘š , ๐‘š๐‘š ๐‘ž๐‘ž ๐‘—๐‘— ๐’’๐’’log ~N( ๏ฟฝ, ๐œท๐œท2๐‘—๐‘— )๏ฟฝ,

~๐‘Ž๐‘ŽDirichlet๐‘˜๐‘˜ ๐œ‡๐œ‡๐‘Ž๐‘Ž(๐œŽ๐œŽ๐‘Ž๐‘Ž ). ๐œ…๐œ… Here the indices , , and refer to loci, lineages๐œฟ๐œฟ๐ด๐ด and subpopulations,๐œท๐œท๐ด๐ด respectively. In the numerical examples of this paper, we assume the values = , = 1, 2 = 2. We set the number of ๐‘—๐‘— ๐‘˜๐‘˜ ๐ด๐ด ๐‘ž๐‘ž lineages equal to the number of populations, and assume๐‘—๐‘— that lineage makes the dominant ๐œท๐œท๐‘—๐‘— ๐Ÿ๐Ÿ๐‘›๐‘› ๐œ‡๐œ‡๐‘Ž๐‘Ž ๐œŽ๐œŽ๐‘Ž๐‘Ž contribution to population , i.e. that the matrix is diagonally dominant. To do so, we let ๐ด๐ด ๐ด๐ด ๐œฟ๐œฟ 0.2 = 0.8, and = for , 1 ๐œ…๐œ… ๐œ…๐œ… ๐›ฝ๐›ฝ๐ด๐ด๐ด๐ด ๐›ฝ๐›ฝ๐ด๐ด๐ด๐ด ๐‘˜๐‘˜ โ‰  ๐ด๐ด and truncate the prior by the requirement that >๐‘›๐‘›๐ฟ๐ฟ โˆ’ for all . The latter specification ensures that label switching is not possible, which๐œ…๐œ… property๐œ…๐œ… improves the mixing of Markov Chain ๐›ฝ๐›ฝ๐ด๐ด๐ด๐ด ๐›ฝ๐›ฝ๐ด๐ด๐ด๐ด ๐‘˜๐‘˜ โ‰  ๐ด๐ด Monter Carlo (MCMC) algorithm (GELMAN et al. 2004).

The number of alleles in neutral marker locus in the ancestral generation is generally unknown, as some alleles may have disappeared after the lineages have diverged or are not present in the sampled ๐‘›๐‘›๐‘—๐‘— ๐‘—๐‘— individuals. Due to mathematical properties of the Dirichlet distribution, we may pool all such unobserved alleles into one โ€˜meta-alleleโ€™. Thus, we define as the number of distinct alleles observed in locus plus one. ๐‘›๐‘›๐‘—๐‘— ๐‘—๐‘— 12 SI O. Ovaskainen et al.

Parameter estimation through MCMC

Each model parameter was sampled from its full conditional while keeping the other parameters fixed. Most parameters were updated using a random-walk Metropolis-Hastings (MH) algorithm, the proposal distributions given below. For these the variances of the proposal distributions were adjusted during the burn-in following Ovaskainen et al. (2008) to give an accept ratio of 0.44 for a single parameter or 0.22 for a vector of parameters.

โ€ข Sampling the additive genetic variance-covariance matrix was conducted using the MH algorithm. We used the proposal distribution Wishart( /๐’œ๐’œ, ), where the parameter was ๐†๐† adjusted during the burn-in. ๐’œ๐’œ ๐†๐† ฮฝ ฮฝ ฮฝ

โ€ข Sampling the residual variance-covariance matrix E was conducted using the MH algorithm. We used the proposal distribution Wishart( E / , ), where the parameter was adjusted during the ๐•๐• burn-in. ๐•๐• ฮฝ ฮฝ ฮฝ

โ€ข Sampling the overall mean and the population specific means . Conditional on the other parameters, the full conditional joint distribution of the parameters๐’ซ๐’ซ ( , ) follows a multivariate ๐๐ ๐€๐€ normal distribution. These parameters were thus updated directly (not using๐’ซ๐’ซ the MH algorithm) ๐๐ ๐€๐€ by drawing a random deviate from the full conditional.

โ€ข Sampling drift parameters . We used N( , 2 ) distributions separately for each to draw 2 proposals for log . The variance parameters ๐‘˜๐‘˜ were adjusted during the burn-in. ๐’‚๐’‚ ๐‘Ž๐‘Ž๐‘˜๐‘˜ ๐›ฟ๐›ฟ๐‘Ž๐‘Ž ๐‘˜๐‘˜ ๐‘˜๐‘˜ ๐‘Ž๐‘Ž๐‘˜๐‘˜ ๐›ฟ๐›ฟ๐‘Ž๐‘Ž โ€ข Sampling lineage loadings . We used truncated Dirichlet( ) distributions separately for

each and to draw proposals for . The โ€™s are proposal๐ด๐ด parameters that were adjusted ๐œฟ๐œฟ ๐›ฟ๐›ฟ๐œฟ๐œฟ ๐œฟ๐œฟ๐ด๐ด during the burn-in. ๐ด๐ด ๐ด๐ด ๐‘—๐‘— ๐œฟ๐œฟ๐ด๐ด ๐›ฟ๐›ฟ๐œฟ๐œฟ

โ€ข Sampling ancestral allele frequencies . We used truncated Dirichlet( ) distributions

separately for each to draw proposals for . The โ€™s are proposal parameters๐‘—๐‘— that were ๐’’๐’’ ๐›ฟ๐›ฟ๐‘ž๐‘ž ๐’’๐’’๐‘—๐‘— adjusted during the burn-in. ๐‘—๐‘— ๐‘—๐‘— ๐’’๐’’๐‘—๐‘— ๐›ฟ๐›ฟ๐‘ž๐‘ž

โ€ข Sampling allele frequencies . We used Dirichlet( ) distributions separately for each

lineage and locus . The โ€™s parameters were adjusted๐‘˜๐‘˜๐‘˜๐‘˜ during the burn-in. ๐’›๐’› ๐›ฟ๐›ฟ๐’›๐’› ๐’›๐’›๐‘˜๐‘˜๐‘˜๐‘˜ ๐‘˜๐‘˜๐‘˜๐‘˜ ๐‘˜๐‘˜ ๐‘—๐‘— ๐›ฟ๐›ฟ๐’›๐’›

O. Ovaskainen et al. 13 SI

We implemented the algorithm in Mathematica 7.1 (WOLFRAM RESEARCH 2008), and used 1,000 iterations for the burn-in and 2,000 for sampling the posterior distribution. We note that these sample sizes are rather small, and they were chosen due to logistic constrains (the estimation was conducted for 3,600 data sets in total). We tested for the sufficiency for mixing by examining the chains for convergence and for running a sample of the datasets for 10,000 + 20,000 iterations. Both tests (as well as the Results, which separated well the cases with and without selection, see main text) indicated that the length of the MCMC chain was sufficient for the present purpose. For the case of real data analysis, we naturally recommend a much longer MCMC chain.

Supplementary Figure 1. Directed acyclic graph (DAG) for the Bayesian model. The quantities in the ellipses are the parameter values being estimated. In the single boxes are the observations (the neutral data and the quantitative trait data ) and in the double boxes are the fixed quantities. The full arrows give stochastic relationships (i.e. those that have probability distributions associated with ๐‘ฟ๐‘ฟ ๐’๐’ them) and the dashed arrows are for deterministic relationships.

14 SI O. Ovaskainen et al.

References ALBERT, A. Y. K., S. SAWAYA, T. H. VINES, A. K. KNECHT, C. T. MILLER et al., 2008 The genetics of adaptive shape shift in stickleback: Pleiotropy and effect size. 62: 76-85. GELMAN, A., J. B. CARLIN, H. S. STERN and D. B. RUBIN, 2004 Bayesian Data Analysis. Chapman & Hall/CRC, Boca Raton. KARHUNEN, M., and O. OVASKAINEN, 2011 Defining and estimating FST through coancestry. Manuscript. WOLFRAM RESEARCH, I., 2008 Mathematica Edition: Version 7.1. Wolfram Research, Inc., Champaign, Illinois.

O. Ovaskainen et al. 15 SI

File S3

Generation of individual-based data

We assumed that in each generation of each population the breeding population consists of 20 individuals. We assumed a hermaphrodite species and randomized the two parents for each propagule independently of each other (selfing allowed). To model gene flow among the populations, we assumed that the parent is an immigrant from one of the other populations with probability =0.01.

๐œ€๐œ€ We assume a set of 32 loci determining the genotypic values among these traits, with 5 allelic variants in each locus, each having an equal frequency in the ancestral generation. We randomized the additive values of each allele in each locus from a two-dimensional multivariate normal distribution with mean zero and such a variance-covariance matrix (see Appendix A) that the expected amount of additive genetic variation in the ancestral generation was 1.0 0.9 E[ ] = . 0.9 1.0 ๐’œ๐’œ ๐†๐† ๏ฟฝ ๏ฟฝ The phenotypic value of individual was modeled as the sum of the additive component and the environmental effect, i.e. = + , where the environmental effect was randomized from the ๐‘–๐‘– two dimensional multivariate normal distribution with mean zero and variance-covariance matrix ๐ณ๐ณ๐‘–๐‘– ๐š๐š๐‘–๐‘– ๐ž๐ž๐‘–๐‘– ๐ž๐ž๐‘–๐‘–

0.5 0 = . 0 0.5 ๐•๐•๐ธ๐ธ ๏ฟฝ ๏ฟฝ If modeling traits under selection, we let the populations become adapted locally to their environments by assuming that the environment experienced by a population favored an optimal phenotype . We assumed that the values are distributed (i.i.d. among the populations) multinormally with mean zero ๐‘‹๐‘‹ ๐’’๐’’๐‘‹๐‘‹ and variance covariance๐‘‹๐‘‹ matrix ๐’’๐’’ 5 4.5 = , 4.5 5 โˆ’ ๐•๐•๐‘†๐‘† ๏ฟฝ ๏ฟฝ and we thus have assumed that the expected directionโˆ’ of population divergence through the selective gradient is not proportional to . ๐’œ๐’œ ๐†๐† We assume that the populations undergo weak selection, so that the initial number of propagules produced is high (ten times the actual population size), and selection operates through competition influencing survival. We define the of an individual with phenotype in population as

๐ณ๐ณ ๐‘—๐‘— ( ) = exp( ( ) 1( )) โˆ’ ๐‘Š๐‘Š๐‘—๐‘— ๐ณ๐ณ โˆ’ ๐ณ๐ณ โˆ’ ๐’’๐’’๐‘—๐‘— ๐•๐•๐น๐น ๐ณ๐ณ โˆ’ ๐’’๐’’๐‘—๐‘—

16 SI O. Ovaskainen et al. where the variance-covariance matrix

0.5 0 = 0 0.5 ๐•๐•๐น๐น ๏ฟฝ ๏ฟฝ describes the shape of the around the local optimum. We selected the 20 individuals that survived to form next generation among 200 propagules by sampling each individual with a probability that was proportional to its fitness value. In the case of no selection, the weights were set equal for all individuals.

To generate phenotypic data that allows for the estimation of genetic variability among and between populations, we assumed a breeding design in which five pairs of individuals were randomly sampled from each of the eight populations. We assumed a full-sib design with five offspring for each of the pairs, so that the total number of offspring was 8 x 5 x 5 = 200. These individuals were assigned environmental effects as for the wild individuals, and their phenotypes were then recorded.

For neutral molecular markers, we also assumed a set of 32 loci with 5 alleles in each locus with equal frequencies in the ancestral population. We randomized the flow of the neutral alleles from the ancestral to the present generation, sampled ten individuals from each population, and genotyped these for the neutral molecular markers.

O. Ovaskainen et al. 17 SI

File S4

Implementation of the method of Martin et al. (2008)

We analyzed the simulated data sets with Martin et al.โ€™s method (MARTIN et al. 2008b). This method involves two separate tests: Comparing the estimates of the intra-population G matrix and the covariance matrix of population means for proportionality, and secondly, testing the proportionality coefficient of these matrices against the FST of molecular markers. The first test should see selection that has a magnitude comparable to random drift, but a direction incompatible with . The second test should see selection that has a magnitude incompatible with random drift, whether balancing๐’œ๐’œ or ๐†๐† disruptive. Both tests are based on the assumption that

2FST E[ ] = E[ ] 1 FST ๐ƒ๐ƒ ๐†๐†๐‘‹๐‘‹ under neutrality. We performed these tests followingโˆ’ the procedure described by the authors (CHAPUIS et al. 2008; MARTIN et al. 2008b). Thus, we estimated the G matrices using Rโ€™s MANOVA with three covariance components: inter-population, inter-family and inter-individual. The inter-population covariance matrix was used as an estimate of E[ ], whereas the inter-population covariance matrix was multiplied by two to yield an estimate of E[ ], which is appropriate for full-sib study design (LYNCH ๐ƒ๐ƒ and WALSH 1998). Because the phenotypic data was known to be multivariate normal, it was not Cox ๐†๐†๐‘‹๐‘‹ transformed, but we followed the recommendation of standardization (CHAPUIS et al. 2008).

After this, the proportionality of E[ ] and E[ ] was tested, and a 95 % confidence interval was derived for the proportionality coefficient using code provided by MARTIN et al. (2008a). The Bartlett p ๐ƒ๐ƒ ๐†๐†๐‘‹๐‘‹ value of the proportionality test was recorded. To perform the second test of MARTIN et al. (2008b), a 95 % confidence interval was estimated for the FST using bootstrap over loci and the Weir-Cockerham estimator (WEIR and COCKERHAM 1984) implemented in Fstat (GOUDET 1995). The confidence interval 2FST of FST was transformed into the confidence interval of . This was compared with the confidence 1 FST interval of the proportionality coefficient obtained from โˆ’the phenotypic data. If these intervals did not overlap, this was taken as a signal of selection.

References

CHAPUIS, E., G. MARTIN and J. GOUDET, 2008 Effects of Selection and Drift on G Matrix Evolution in a Heterogeneous Environment: A Multivariate Q(st)-F-st Test With the Freshwater Snail Galba truncatula. Genetics 180: 2151-2161. GOUDET, J., 1995 FSTAT (Version 1.2): A computer program to calculate F-statistics. Journal of Heredity 86: 485- 486.

18 SI O. Ovaskainen et al.

LYNCH, M., and B. WALSH, 1998 Genetics and analysis of quantitative traits. Sinauer Associates Incorporated, New York. MARTIN, G., E. CHAPUIS and J. GOUDET, 2008a http://www.isem.cnrs.fr/spip.php?article934, pp. Institut des sciences de l'evolution montpellier, Montpellier. MARTIN, G., E. CHAPUIS and J. GOUDET, 2008b Multivariate Q(st)-F-st Comparisons: A Neutrality Test for the Evolution of the G Matrix in Structured Populations. Genetics 180: 2135-2149. WEIR, B. S., and C. C. COCKERHAM, 1984 Estimating F-Statistics for the Analysis of Population-Structure. Evolution 38: 1358-1370.

O. Ovaskainen et al. 19 SI