Skip to main content

Forecasting Methodology

How Censai forecasts inflows, outflows, and net migration four quarters out using Random Forest and XGBoost models, with accuracy benchmarks by geography level.

F
Written by Fulton Taylor

CENSAI releases quarterly updates to forecasts that project inflows, outflows, and net migration four quarters into the future. The forecasts are available at the zip-code, county (FIPS), CBSA, and state level.

Term

Definition

Median Absolute Error

At every quarter for each specific geography (zip code, county, etc.) we record the absolute value of each model’s error (how many individual moves we missed). The median of all the error values across dates or geographies is then calculated.

Mean Absolute Error

Like the median absolute error except that the mean value is taken when aggregating across time or geography.

Seasonal Naive Model

In our context the seasonal naive model predicts that the forecast for any quarter equals the actuals of the same quarter one year earlier. For instance, we would forecast Q4 2024 as being equal to Q4 2023. Due to seasonal and often consistent migration trends, this forms a reasonable forecast for our data which we then build upon with our models.



The model utilizes quarterly data from 2016:Q1 through 2022:Q4 and backtests over 2023:Q1-Q4. Net Migration and inflows are forecasted with both Random Forest and XGBoost models. Outflows are then computed quarterly using the following equation:

Net Migration = Inflows – Outflows.

In the event of a negative Outflow forecast, we correct the outflow number to zero and attenuate our Net Migration forecasts such that the above equation holds true. This occurs for a small percentage of forecasts and only within the zip code geography.

Both models forecast at the zip code level and results are aggregated up into county, CBSA and state forecasts. All methods are compared with a quarterly seasonal naive model utilizing both the median and mean absolute error statistics. Model selection is made with special emphasis on Net Migration forecasting performance. Since it is easier to perceive migration trends in larger geographies (states, cities and counties) than smaller geographies (zip codes), we place increased importance on giving accurate insights into over 34,000 zip codes across the United States.

For our Q1 – Q4 2024 forecasts, we blend the two modeling methods – generating net migration with a Random Forest and Inflows with XGBoost. These two methods performed best in class on their respective series. The table below presents the median and mean absolute errors for each geography and series across the backtest period. For example, across all four quarters of our backtest period, and all 34,158 distinct zip codes, our model’s net migration median absolute error equals 6.4 persons. This is 28.9% improvement (highlighted in green) over the seasonal naive model score of 9 persons.

This same logic follows and scales to larger geographies within the table. Despite its name, the seasonal naive model performs well on our data due to persistent seasonal migration trends. The percentages in the table are meant to highlight the lift given by our model to an already reasonable estimate. In line with our intentions, our model performs best at the Zip Code level followed by State, County and CBSA respectively.

Forecast Performance Metrics

Net Migration

Median Absolute Error

Net Migration

Mean Absolute Error

Zip Codes

6.4 +28.9%

16.9 +25.2%

Counties (FIPS)

28.5 +16.7%

156.7 +12%

CBSAs

69 +10.4%

447.0 *0%

States

928 +18.3%

1820.0 +28.1%

*The seasonal naive model scored 444 persons for its CBSA MAE making the performance difference effectively zero. This is likely due to the mean statistic being more susceptible to outliers since we see a decent lift of +10.4% in the CBSA median absolute error.

Sample Net Migration Forecast:

This plot showcases our net migration models in action forecasting a busy Miami zip code. Note that all models correctly produced negative net migration estimates with the Random Forest model (blue) capturing both the shape and scale of the real series (‘Actuals’ in blueish-green).

Did this answer your question?