RadiationMixing#

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

Bases: BaseMixing

Radiation migration model where outbound migration flux from origin to destination is enhanced by destination population and absorbed by the density of nearer destinations.

Formula:
\[M_{i,j} = k \frac{p_i p_j}{\left(p_i + \sum_{k \in \Omega(i,j)} p_k\right)\left(p_i + p_j + \sum_{k \in \Omega(i,j)} p_k\right)}\]
Parameters:
  • include_home (bool) – Whether to include home in the migration matrix

  • k (float) – Scale parameter (avg trip probability)

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