StoufferMixing#

class StoufferMixing(scenario=None, params=None)[source]#

Bases: BaseMixing

Stouffer migration model where long distance travel is impacted by intervening opportunities.

Formula:
\[M_{i,j} = k p_i^a \sum_j \left(\frac{p_j}{\sum_{k \in \Omega(i,j)} p_k}\right)^b\]
Parameters:

include_home (bool) – Whether to include home in the migration matrix

get_migration_matrix()[source]#

Initialize a migration/diffusion matrix for population mixing. The diffusion matrix is a square matrix where each row represents the outbound migration from a given patch to all other patches e.g., [i,j] = [from_i, to_j].

Convention is: - Trips into node j: N_i @ M[i,j] - Trips out of node i: np.sum(M[i,j] * N_i[:,np.newaxis], axis=1)

Returns:

The diffusion matrix: (N, N)

Return type:

ndarray