← Back to list

Forecasting Mortgage Rates with Machine Learning and Macro Scenarios

Building a data-driven mortgage rate forecasting system with probabilistic outcomes

Mattsomm · 2026-05-05 03:09 · 1 claps · 4.0 min read
#time-series-forecasting #monte-carlo-simulation #machine-learning #mortgage #forecasting
Open on Medium ↗
Wiki topics: ML · Machine Learning PFI · Personal Finance EDU · Education & Learning GRW · Growth & Analytics

Forecasting Mortgage Rates with Machine Learning and Macro Scenarios

Building a data-driven mortgage rate forecasting system with probabilistic outcomes

Mortgage rates are driven by a combination of macroeconomic and market forces. Mortgage rates play a central role in housing affordability, consumer decisions, and the broader economy. Yet their behavior is difficult to forecast with consistency.

Most approaches rely on simple heuristics or short-term statistical models. These methods can work over short horizons, but they tend to break down over longer periods when macroeconomic forces begin to dominate. In this project, I built a forecasting system designed to address that gap. The goal was not just to predict the next move in mortgage rates, but to understand how they might evolve under different economic conditions.

The system combines three ideas:

  • A structural decomposition of mortgage rates into underlying components
  • Machine learning models for short-term prediction
  • A scenario-based simulation framework for long-term uncertainty

This transforms a single prediction into a distribution of possible outcomes over the next year.

Decomposing Mortgage Rates

Instead of forecasting mortgage rates directly, I modeled them as:

Mortgage Rate = 10-Year Treasury Yield + Mortgage Spread

This decomposition provides a clearer structure:

  • The 10-year Treasury yield reflects macroeconomic conditions and monetary policy
  • The mortgage spread captures credit risk, liquidity, and market stress

Modeling these components separately improves both predictive performance and interpretability.

Building the Models

Using macroeconomic and financial data from Federal Reserve Economic Data, I trained two models:

  • One model predicts changes in the 10-year Treasury yield
  • One model predicts changes in the mortgage spread

The feature set includes:

  • Yield curve data
  • Volatility indicators such as the VIX
  • Credit spreads
  • Rolling statistics and momentum features
dgs10_model = Pipeline([
    ("scaler", StandardScaler()),
    ("ridge", Ridge(alpha=1000)),
])

spread_model = Pipeline([
    ("scaler", StandardScaler()),
    ("ridge", Ridge(alpha=500)),
])

dgs10_model.fit(X_dgs10_train, y_dgs10_train)
spread_model.fit(X_spread_train, y_spread_train)

For short-term horizons between one and four weeks, this approach consistently outperformed baseline models.

The Problem with Long-Term Forecasts

As the horizon extends to twelve months, the problem changes.

Point forecasts become less reliable because:

  • Macroeconomic regimes shift
  • Uncertainty compounds over time
  • Multiple future paths become plausible

So instead of asking:

“What will mortgage rates be in twelve months?”

A better question is:

“What range of outcomes is realistically possible?”

A Better Approach: Scenario-Based Monte Carlo

To answer that question, I built a Monte Carlo simulation framework.

Each simulated path evolves over 52 weeks using:

  • Predictions from the trained models
  • Random shocks calibrated from historical residuals

Mean reversion:

  • Treasury yields move toward a long-run equilibrium near 4 to 4.5 percent
  • Mortgage spreads move toward their historical averages

The key addition is the use of macroeconomic scenarios. This shifts the problem from predicting a single path to understanding how different economic conditions shape the range of outcomes.

Modeling Economic Scenarios

The simulation incorporates five scenarios:

Each scenario changes the behavior of:

  • Interest rate drift
  • Spread dynamics
  • Volatility

From Scenarios to Probabilities

Each scenario is assigned a probability weight. These weights represent a structured macroeconomic view rather than a model output.

Example weighting:

  • Base Case: 40 percent
  • Higher-for-Longer: 25 percent
  • Soft Landing: 20 percent
  • Recession: 10 percent
  • Financial Stress: 5 percent

This setup captures:

  • Inflation persistence risk
  • Downside risk from economic contraction
  • Tail risk from financial instability

Results: A Distribution, Not a Point Estimate

The simulation produces a full distribution of possible mortgage rate paths.

Here’s the 12-month forecast across different economic views:

At the 52-week horizon:

  • Median forecast: ~6.4%
  • Central range (25th–75th): ~5.9% to ~7.0%
  • Wider range (5th–95th): ~5.1% to ~7.8%

Interpreting the Results

Several patterns emerge:

1. Rates remain elevated in most scenarios

Mortgage rates cluster in the mid-6 percent range across the majority of simulations.

2. Inflation persistence drives higher outcomes

Higher-for-longer scenarios push rates upward through sustained Treasury yields.

3. Recession lowers rates, but not dramatically

Falling yields are partially offset by wider spreads.

4. Tail risk is asymmetric

Financial stress scenarios increase rates through spread expansion.

Why This Approach Matters

Traditional models produce a single number. This framework produces a range of outcomes with associated probabilities.

That distinction is important. It reflects how professional investors and macroeconomic analysts approach forecasting. Short-term forecasting focuses on precision. Long-term forecasting focuses on distributions.

Conclusion

This project began as a machine learning exercise and evolved into a broader forecasting system:

  • A decomposed model of mortgage rates
  • A macro-aware simulation engine
  • A probabilistic view of future outcomes

Instead of trying to predict a single value, the system provides a more realistic answer:

“Here is what is likely, and here is what could happen.”

Github repo can be found here:


메타데이터
post_id
4d3608d5f3fe
slug
forecasting-mortgage-rates-with-machine-learning-and-macro-scenarios-4d3608d5f3fe
url
https://medium.com/@mattsomm/forecasting-mortgage-rates-with-machine-learning-and-macro-scenarios-4d3608d5f3fe
canonical_url
https://medium.com/@mattsomm/forecasting-mortgage-rates-with-machine-learning-and-macro-scenarios-4d3608d5f3fe
author_url
https://medium.com/@mattsomm
status
ok
fetched_at
2026-06-09 15:37:30