calc_migration_matrix

calc_migration_matrix(demes, rate, scale=True)

Calculates a migration matrix based on deme sizes and a global migration rate. The migration rate can be scaled based on population size or set as a constant.

Parameters

Name Type Description Default
demes np.ndarray The 2D numpy array representing the deme sizes. required
rate float The migration rate. required
scale bool Whether to scale the migration rate based on population size. Default is True. True

Returns

Type Description
np.ndarray The migration matrix as a 2D numpy array.