Backward, forward ...interpretation of migration rates

1,597 views
Skip to first unread message

daniel berner

unread,
Jul 3, 2014, 10:30:23 AM7/3/14
to fasts...@googlegroups.com
Dear Laurent

I am uncertain how to exactly interpret the migration rates, as they are backward in time. An example: when fastsimcoal estimates m_i_to_j *backward* from present to time T as 0.05, does this mean that from T to present (hence *forward*), the migration rate was 0.05 from i to j (that is, the estimate is the *emigration* probability from deme i)? Or does the forward interpretation require to switch the directionality of the migration rate, such that the 0.05 above actually reflects the *immigration* probability into deme i?

Cheers,
daniel

Laurent Excoffier

unread,
Jul 9, 2014, 10:19:49 AM7/9/14
to fasts...@googlegroups.com
If I set up the following migration matrix

0      m01
m10    0

m01 is the backward migration rate from deme 0 to deme 1, and m10 is backward migration rate from deme 1 to deme 0.

It means that in the coalescent simulation, m01 is the probability for any lineage present in deme 0 to move to deme 1.
Forward in time m01 is the emigration rate from deme 1 into deme 0.

Hope it helps

laurent

daniel berner

unread,
Jul 9, 2014, 6:08:56 PM7/9/14
to fasts...@googlegroups.com
Laurent

Thanks for your responses! I am sorry I am still not 100% certain about migration. let me get back to your example:

0 m01
m10 0

I understand that backward in time, m01 is the probability of a gene to move from pop0 to pop1. Hence, Npop0*m01 is here the number of migrants leaving pop0, right?
But looking forward in time, can I calculate Npop0*m01 to obtain the number of individuals *arriving* to pop0 (and originating from pop1)? Or instead, should I calculate Npop1*m01 to obtain the number of individuals *leaving* pop1 (toward pop0)? In the former case, the reference pop to which the migration probability refers is pop0 in both backward and forward direction, whereas in the latter case, the reference pop flips between forward and backward.

And to make sure, fastsimcoal consistently deals with haploids, hence Npop0*migRate is the number of haploids; diploid is Npop0*migRate/2, correct?

Daniel

Laurent Excoffier

unread,
Jul 10, 2014, 4:35:38 AM7/10/14
to fasts...@googlegroups.com

I understand that backward in time, m01 is the probability of a gene to move from pop0 to pop1. Hence, Npop0*m01 is here the number of migrants leaving pop0, right?

yes

But looking forward in time, can I calculate Npop0*m01 to obtain the number of individuals *arriving* to pop0 (and originating from pop1)?

Yes, indeed what matters as far as genetic diversity in pop 0 is concerned is the product Npop0*m01 (the number of emigrant genes going backward in time)

Or instead, should I calculate Npop1*m01 to obtain the number of individuals *leaving* pop1 (toward pop0)?

No, this forward rate is not relevant here neither for pop1 nor for pop0.

In the former case, the reference pop to which the migration probability refers is pop0 in both backward and forward direction, whereas in the latter case, the reference pop flips between forward and backward.

And to make sure, fastsimcoal consistently deals with haploids, hence Npop0*migRate is the number of haploids; diploid is Npop0*migRate/2, correct?

yes


dam.v...@gmail.com

unread,
Aug 18, 2014, 5:56:50 AM8/18/14
to fasts...@googlegroups.com
Dear Laurent,
Thanks for spending the time to help all of us.
Given the above response, I was wondering why the migration rates are specified in the example IM model as:

0 MIG2
MIG1 0

with:
0 MIG1 = 2NM1/NPOP1 hide
0 MIG2 = 2NM2/NPOP2 hide

Perhaps I misunderstand, but using the notation above this seems equivalent to m01*Npop1/2 = N migrants from 0 to 1 backward in time.

Laurent Excoffier

unread,
Aug 18, 2014, 9:05:42 AM8/18/14
to fasts...@googlegroups.com
I think you have rightly spotted a problem.

The migration matrix should be defined in that case as

0 MIG1
MIG2 0

The 2Nm value of interest for a population is the product of the local population size by the forward immigration rate (or the backward emigration rate). Going backward in time it is the number of genes leaving the population per generation.

I'll correct it in the manual and example files.

dam.v...@gmail.com

unread,
Aug 18, 2014, 10:00:50 AM8/18/14
to fasts...@googlegroups.com
Thanks Laurent!

jason....@gmail.com

unread,
Mar 27, 2015, 6:02:36 PM3/27/15
to fasts...@googlegroups.com
I just checked the manual, and I don't think the mistake has been changed. I would just like to verify as I am implementing this model. Cheers.

jason....@gmail.com

unread,
May 29, 2015, 11:19:33 AM5/29/15
to fasts...@googlegroups.com
Hi Laurent,

Again, just a reminder that this very important example error has not yet been changed in the manual. I have been tripped up by the IM example in the manual multiple times now, and only catch the error when I refer back to this thread.

Model formulation is rather confusing to figure out in general, and I find there are many opportunities to introduce errors like this one. Unfortunately, when these errors are generated, the user often is unaware of the error because fastSIMCOAL2 does not always crash and does not provide warnings when these erroneous formulations are made in a model. Though I am sure your time to devote to this is very limited, it would be very useful to program into fsc a series of model checks so the user can be warned if the model does not makes sense, and if violations are encountered a serious of warning messages are returned. DIYABC has a useful graphing feature in this regard whereby a graph of the model is returned. It helps to be able to visually see the model one has just attempted to program in order to check for potential errors.

Just wish-list suggestions to what is a very powerful and well thought out piece of software.

Jason

Laurent Excoffier

unread,
May 31, 2015, 7:44:59 AM5/31/15
to fasts...@googlegroups.com
I have now corrected the manual for that, thanks for pointing it out to me, I had forgotten it.

I agree that it would be nice to have an illustration of the planned scenario, but it is not that easy to do. I'll see if this can be done in the future

best

L

jason....@gmail.com

unread,
May 31, 2015, 12:28:04 PM5/31/15
to fasts...@googlegroups.com
Hi Laurent,

I think in v5.2.5.8 the manual still has a mistake for the IM example. The matrix should be:
0 MIG12
MIG21 0

rather than:
0 MIG21
MIG12 0

Otherwise, the example is coded the same as before.

Jason

Laurent Excoffier

unread,
May 31, 2015, 5:18:08 PM5/31/15
to fasts...@googlegroups.com
No it is correct.
I checked the file, checked the estimation, and everything is okay now
m21 is the forward migration rate from population 2 to 1 (1 to 0)
L

jason....@gmail.com

unread,
Jun 1, 2015, 8:36:55 PM6/1/15
to fasts...@googlegroups.com
Laurent,

Sorry, I just want to make sure I understand this so I interpret my results correctly and I am still a bit lost by the coding in the current 2.5.2.8 version manual which is:

0 MIG21
MIG12 0

[COMPLEX PARAMETERS]
0 MIG12 = N1M21/NPOP1 output
0 MIG21 = N2M12/NPOP2 output

It seems to me that NPOP1 and NPOP2 are reversed. Should the coding not be one of the following two equivalent options?
A)OPTION 1

0 MIG21
MIG12 0

[COMPLEX PARAMETERS]
0 MIG12 = N1M21/NPOP2 output
0 MIG21 = N2M12/NPOP1 output

OR

B) OPTION 2

0 MIG12
MIG21 0

[COMPLEX PARAMETERS]
0 MIG21 = N1M21/NPOP2 output
0 MIG12 = N2M12/NPOP1 output

I appreciate your patience on this and sorry to push this again. I thought I understood and now am uncertain.

Jason

Laurent Excoffier

unread,
Jun 2, 2015, 3:13:24 AM6/2/15
to fasts...@googlegroups.com
Hi Jason

in the migration matrix

0 MIG21
MIG12 0

MIG21 is the probability for any lineage of deme 0 to move to deme 1, BACKWARD IN TIME
So, forward in time, it it the migration rate from deme 1 to deme 0 (hence its name MIG21, which could hav ebeen called MIG10, but it is in line with the drawing of the scenarion in the manual)

N1M21 is the product of the (forward in time) immigration rate by the deme size. Seen backward in time it is the number of genes that move from deme 0 to deme 1.
It is this parameter that will define the degree of genetic isolation of this population.
So, in order to get MIG21, you need to divide N1M21 by NPOP1
as is mentioned in the manual.

Hope it helps

laurent


jason....@gmail.com

unread,
Jun 2, 2015, 6:10:07 AM6/2/15
to fasts...@googlegroups.com
Hi Laurent,

You stated "So, in order to get MIG21, you need to divide N1M21 by NPOP1 as is mentioned in the manual." I agree, but doesn't the manual show the opposite - that in order to get MIG21 you divide N2M12 by NPOP2. That is the part I think is worded incorrectly in the manual.

Thanks,
Jason

Laurent Excoffier

unread,
Jun 2, 2015, 9:40:59 AM6/2/15
to fasts...@googlegroups.com
oh my...
yes you are right.
I'll update the manua asap
L

jason....@gmail.com

unread,
Jun 2, 2015, 10:07:32 AM6/2/15
to fasts...@googlegroups.com
Hi Laurent,

After doing some external reading I am beginning to think your original manual example in previous versions was right all along and that what is instead wrong is the above comments to Daniel Berner regarding the definition of backward migration. Above you define backward migration (m01: where 0 = deme 0 and 1 = deme 1) as "the probability for any lineage present in deme 0 to move to deme 1." Kent Holsinger (as cited here: http://popgen.sc.fsu.edu/Migrate/Blog/Entries/2013/3/22_forward-backward_migration_rates.html) instead defines it as "the probability that a randomly chosen individual in this generation came from a population different from the one in which it is currently found in the preceding generation." Your definition above describes a backwards emigration rate, whereas Kent Holsinger's definition describes a backward immigration rate. Is it not the latter that you want? In that case where:
0 M01
M01 0

M01 = 2NM1/NPOP1

This is how you originally had it in the manual and I think that was correct. I could be wrong of course.

Jason

Laurent Excoffier

unread,
Jun 3, 2015, 4:31:51 PM6/3/15
to fasts...@googlegroups.com
I think I have been always right in the definition of the migration rates, but I may have used inconsistent notations at times, sometimes implying forward, sometimes implying backward migration rates. In the latest version of the manual (2528), the notation for IM20Mb is now forward in time, and I think it is also correct.

Note that in the IM20Mb example above, as far as estimation is concerned, it does not really matter if we divide 2NM1 by NPOP1 or NPOP2 to get M01, since 2NM1 are dummy variables which will be adjusted to get the right M01 value in the optimization process.

However, I agree we should be careful about notations

jason....@gmail.com

unread,
Jun 3, 2015, 4:55:41 PM6/3/15
to fasts...@googlegroups.com

> Note that in the IM20Mb example above, as far as estimation is concerned, it does not really matter if we divide 2NM1 by NPOP1 or NPOP2 to get M01, since 2NM1 are dummy variables which will be adjusted to get the right M01 value in the optimization process.


OK, good to know. In that case we could just drop the complex parameters for this and simply estimate M01 as a simple parameter directly?

Laurent Excoffier

unread,
Jun 5, 2015, 4:44:09 PM6/5/15
to fasts...@googlegroups.com
Yes, I agree, but I have personally no real feeling for raw migration rates, as the same migration rate for a small or a large may imply very different levels of isolations.
I personally prefer to parameterize migration in terms of Nm, and set its range from 1e-2 to 1e2, as these figures speak more to me.
best
L.
Message has been deleted

jason....@gmail.com

unread,
Oct 2, 2015, 5:11:54 PM10/2/15
to fastsimcoal
Hi Laurent,

I see your point, but it is not clear to me how to properly parameterize this based on Nm for models with effective population sizes that are growing or shrinking while simultaneously exchanging migrants. Will the Nm transformations be confounded in such models?

Cheers,
Jason

Laurent Excoffier

unread,
Oct 5, 2015, 3:44:34 PM10/5/15
to fastsimcoal
yes, for populations with exponential changes in size, thinking in terms of Nm is not working well. Then I guess  you have to go back to m search ranges
L

guill...@gmail.com

unread,
Feb 24, 2021, 2:04:59 AM2/24/21
to fastsimcoal
Hello,

In relation with this topic, when you compute migration as Nm (for example the N1M21 of the example above) do you get the total number of migrants for the defined period, or do you get a per generation estimate? Thank you.

Guillermo

guill...@gmail.com

unread,
Mar 18, 2021, 8:21:53 AM3/18/21
to fastsimcoal
Hello,

I have visited this thread trying to clear my ideas so many times. There is one thing that totally confuses me: the example IM20Mb looks different in the manual and in the example files distributed with the program (see below). Which is the correct one? Or are they equivalent somehow? Thanks.

Manual ver 2.6, October 2016
[COMPLEX PARAMETERS]
0 RESIZE = ANCSIZE/NPOP2 hide
0 MIG21 = N1M21/NPOP1 output
0 MIG12 = N2M12/NPOP2 output

IM20Mb.est example file:
[COMPLEX PARAMETERS]

0  RESIZE = ANCSIZE/NPOP2     hide
0  MIG12  = N1M21/NPOP1       output
0  MIG21  = N2M12/NPOP2       output

Débora Y. C. Brandt

unread,
Apr 12, 2023, 5:32:07 AM4/12/23
to fastsimcoal2
Hi! I'm also interested in this topic, so I'll try to revive it once again.

I currently have a model that was inferred with fastsimcoal2 and I want to do forward simulations with it. The model includes migration between populations that are undergoing exponential growth. So, I have fastsimcoal2 estimates of Nm that I am interpreting as Ni*m_ij backwards in time, ie, the number of individuals in population i that come from population j (forwards in time) in each generation, averaged over the entire time during which populations i and j were exchanging migrants.

To write this model in forwards simulations, I have calculated what would be the constant m_ij, given the values of Ni per generation (which grow exponentially over T generations). I've been calculating this as m_ij = M*T/sum(Ni_t), where M is the estimate of average Nm from fastsimcoal. This all seems to work ok, but now I'm questioning if it makes sense. It means that as population i increases in size, it receives more migrants from population j. But intuitively, I thought the number of migrants from j should depend more on the size of j than on the size of i itself. So maybe my decision to keeping m_ij constant does not make sense? If not, what would be a better way to do it? Keeping Ni*m_ij constant over T? I think the root of my question is whether popgen theory assumes Nm should be constant or m should be constant, or if it does not make a difference.

Sorry for the long question! I hope this is not too confusing and I'm happy to clarify it. Thanks for lots of useful replies in this group, Laurent!

Best,
Débora
Reply all
Reply to author
Forward
0 new messages