Immigration / Emigration Model

Data

Statistics Canada does not contain immigration/emigration data broken down by the necessary groups (age, sex, etc), so we do not have exact data for this category. Instead, we use the data from the birth and death models.

Population Data

We use the Statistics Canada population data that was generated and saved as: processed_data/{time_delta_tag}/birth/initial_population.csv.

This table contains the number of people in a given age, sex, province, and projection scenario, along with the number of births for that timepoint. This data is the net number of people, factoring in death, immigration, and emigration.

Column

Type

Description

timepoint

int

the starting date / time of the time interval that the data applies to

age

int

the age of the person in years

province

str

the province of the person (e.g., AB = Alberta, BC = British Columbia, etc.)

n_age

int

the number of people in a given age group, time interval, province, and projection scenario

n_birth

int

the number of births in that time interval, province, and projection scenario

prop

float

the proportion of the population in that age group, time interval, province, and projection scenario relative to the number of births in that time interval, province, and projection scenario

prop_male

float

the proportion of the population in a given age group, time interval, province, and projection scenario who are male

projection_scenario

str

the projection scenario used to generate the data

Mortality Data

We use the Statistics Canada population data that was generated and saved as: processed_data/{time_delta_tag}/life_table.csv.

Column

Type

Description

timepoint

datetime

the starting date / time of the time interval that the data applies to

age

int

the age of the person in years

province

str

the province of the person (e.g., AB = Alberta, BC = British Columbia, etc.)

sex

str

F = female, M = male

prob_death

float

the probability that a person of the given age and sex, living in the given province, will die during the given time interval.

se

float

the standard error on the probability of death

Processed Data

The migration model produces a single processed data file generated by leap/data_generation/migration_data.py, covering the provinces CA (all of Canada) and BC (British Columbia).

Saved as: leap/processed_data/{time_delta_tab}/migration/migration_table_{province}_{projection_scenario}.csv.

Each row corresponds to a unique combination of timepoint, province, age, sex, and projection_scenario. The table records the signed net migration (\(\Delta n\)) for each group, along with derived columns used by the simulation at runtime for both immigration and emigration.

\(\Delta n\) is computed independently for each sex. Because males and females are computed separately, it is possible for one sex to have net immigration while the other has net emigration for the same age and timepoint.

Column

Type

Description

timepoint

datetime

the date / time of the time interval that the data applies to

province

str

the province abbreviation (BC or CA)

age

int

the age in years

sex

str

M = male, F = female

projection_scenario

str

the StatCan population projection scenario

delta_n

float

the signed net migration for this age, sex, timepoint, province, and projection scenario; positive values indicate net immigration, negative values indicate net emigration

prop_migrants_birth

float

delta_n divided by the number of births during that time interval; signed — positive for net immigration cells, negative for net emigration cells

prop_immigrants_timepoint

float

for cells where delta_n > 0, each age and sex group’s share of all immigrants arriving in a given year (denominator is the sum of positive delta_n values only); zero for emigration cells

prop_emigrants_timepoint

float

for cells where delta_n < 0, each age and sex group’s share of all emigrants leaving in a given year (denominator is the sum of negative delta_n values only); zero for immigration cells

prob_emigration

float

for cells where delta_n < 0, the per-person annual probability of emigrating, computed as \(|\Delta n| / n\); zero for immigration cells

Model

The following variables will be used in the equations below:

Column

Description

\(x\)

age in years

\(s\)

sex, one of M or F

\(t\)

timepoint, in years

\(\ell(x, t; s)\)

number of people in the population of age \(x\), sex \(s\), at timepoint \(t\)

\(\ell(x, t)\)

number of people in the population of age \(x\) at timepoint \(t\), both sexes

\(\ell(x = 0, t)\)

number of births during the time interval starting at timepoint \(t\), both sexes

\(\Delta n_{\text{migration}}(x, t; s)\)

net migration at timepoint \(t\) for people of age \(x\) and sex \(s\)

\(\Delta n_{\text{total}}(x, t; s)\)

total change in population at timepoint \(t\) for people of age \(x\) and sex \(s\)

\(\Delta n_{\text{deaths}}(x, t; s)\)

total change in population due to deaths at timepoint \(t\) for people of age \(x\) and sex \(s\)

\(q(x-\Delta t,\ t-\Delta t)\)

probability that a person of age \(x-\Delta t\) at the previous timepoint will die during the time interval between the previous timepoint and the current timepoint

Net Migration

To obtain the net migration during a time interval, for anyone aged > 0, we use the difference between the population at the current timepoint and the population at the previous timepoint, after accounting for deaths. This is computed separately for each combination of age, sex, province, and projection scenario. Age 0 is excluded because newborns are handled separately by the Birth Model.

\[\Delta n_{\text{total}} (x,\ t; s) = \Delta n_{\text{migration}}(x,\ t; s) + \Delta n_{\text{deaths}}(x,\ t; s)\]

Solving for \(\Delta n_{\text{migration}}\) gives us the net migration during that time interval:

\[\begin{split}\Delta n_{\text{migration}}(x,\ t; s) &= \textcolor{magenta}{\Delta n(x,\ t; s)_{\text{total}}} - \textcolor{orange}{\Delta n(x,\ t; s)_{\text{deaths}}} \\ &= \textcolor{magenta}{ \underbrace{\ell(x,\ t; s)}_{\text{no. people alive age $x$ at time } t} - \underbrace{\ell(x-\Delta t,\ t-\Delta t; s)}_{ \text{no. people alive age $x-\Delta t$ at previous time } t - \Delta t }} \\ &+ \textcolor{orange}{ \underbrace{ \left(\ell(x-\Delta t,\ t-\Delta t; s) \cdot q(x-\Delta t,\ t-\Delta t; s)\right) }_{\text{no. deaths age $x - \Delta t$ between $[t - \Delta t, t]$}} }\end{split}\]

If \(\Delta n_{\text{migration}} > 0\), the surplus is attributed to immigration. If \(\Delta n_{\text{migration}} < 0\), the deficit is attributed to emigration.

Note

Of course, this assumption is not in general true - for example, if \(\Delta n_{\text{migration}} = 50\), it could be the case that \(100\) people immigrated and \(50\) people emigrated, as opposed to our assumption that \(50\) people immigrated and \(0\) people emigrated. However, for the purposes of our model, it doesn’t matter how many people immigrated or emigrated, just the net effect on the population, so we make the simplifying assumption that all of the net change is due to either immigration or emigration, but not both.

Number of Immigrants

At each timepoint of the simulation, new agents are added to the model, and fall into one of two categories: newborns (handled by the Birth Model) or immigrants. The number of immigrants at a given timepoint of a given age and sex is given by:

\[i(x, t; s) = i(t) \cdot \text{prop immigrants timepoint}(x,t; s)\]

The total number of immigrant agents created in a given time interval \(i(t)\) is:

\[\begin{split}i(t) = \left\lceil \ell(x=0, t) \cdot \sum_{\substack{x,\ s \\ \Delta n > 0}}\ \text{prop migrants birth}(x, t; s) \right\rceil\end{split}\]

where \(\ell(x=0, t)\) is the number of simulated births in that time interval.

prop_migrants_birth is computed as:

\[\text{prop migrants birth}(x, t; s) = \dfrac{\text{no. migrants}}{\text{no. births at timepoint } t} = \dfrac{\Delta n_{\text{migration}}(x, t; s)}{\ell(x=0, t)}\]

prop_immigrants_timepoint is computed as:

\[\begin{split}\begin{align} \text{prop immigrants timepoint}(x, t; s) &= \dfrac{\text{no. immigrants of age $x$, sex $s$ at timepoint } t}{\text{no. immigrants at timepoint } t} \\ &= \begin{cases} \dfrac{\Delta n_{\text{migration}}(x, t; s)}{\sum_{x, s}\ \Delta n_{\text{migration}}(x, t; s)} & \quad \text{if } \Delta n_{\text{migration}} > 0 \\ 0 & \quad \text{ otherwise} \end{cases} \end{align}\end{split}\]

Probability of Emigration

At runtime, the simulation uses prob_emigration directly in a Bernoulli trial for each timepoint to determine whether an agent emigrates:

\[\text{emigrates} \sim \text{Bernoulli}(p_{\text{emigrate}}(\text{sex}, \text{age}, \text{timepoint}))\]

prob_emigration is computed as:

\[\begin{split}\text{prob emigration}(x, t; s) = \begin{cases} \dfrac{|\Delta n_{\text{migration}}(x, t; s)|}{\ell(x, t; s)} & \text{if } \Delta n_{\text{migration}} < 0 \\ 0 & \text{ otherwise} \end{cases}\end{split}\]

Agents aged 0 are excluded — newborns never emigrate.