Will the Recession Ever Arrive? A Data-Driven Look at the Yield Curve and Jobless Rate

I’m always monitoring economic data for clues about where the broader market and sentiment might be headed. Since I’m a visual thinker, I like to create charts—like my egg price and median house price charts. In this post, I’ll share my Python code for generating a chart that overlays the 2-year/10-year Treasury yield spread with the current jobless rate, highlighting recession periods for context. I track this chart closely because the 2-year/10-year spread has historically predicted recessions whenever it turns negative. However, the timing of a recession remains uncertain. This is where jobless rates become a crucial indicator—when employers start shedding jobs, the likelihood of a recession increases. ...

Generate Chart of Median House Prices With Mortgage Rates And Recessions in Python

In case you want to generate a beautiful chart in Python of median house prices with mortgage rates and recessions overlaid, here’s the code. It’s all self explanatory but if you need help, drop me a comment below. import pandas as pd import matplotlib.pyplot as plt from pandas_datareader.data import DataReader from datetime import datetime save_path = "./results/median-house-price-with-mortgage-rates.png" # Fetch median sales price data from FRED def fetch_median_sales_price(): """ Fetches Median Sales Price of Houses in the US from FRED. Returns: DataFrame with date index and median sales price. """ start_date = "1988-01-01" end_date = datetime.now() median_sales_price = DataReader("MSPNHSUS", "fred", start_date, end_date) median_sales_price.rename(columns={"MSPNHSUS": "Median Sales Price"}, inplace=True) return median_sales_price # Fetch mortgage rates from FRED def fetch_mortgage_rates(): """ Fetches 30-Year Fixed Mortgage Rates in the US from FRED. Returns: DataFrame with date index and mortgage rates. """ start_date = "1988-01-01" end_date = datetime.now() mortgage_rates = DataReader("MORTGAGE30US", "fred", start_date, end_date) mortgage_rates.rename(columns={"MORTGAGE30US": "Mortgage Rates"}, inplace=True) return mortgage_rates # Fetch recession data from FRED def fetch_recession_data(): """ Fetches US recession data from FRED. Returns: DataFrame with date index and recession indicators. """ start_date = "1988-01-01" end_date = datetime.now() recession_data = DataReader("USREC", "fred", start_date, end_date) return recession_data def get_recession_periods(recessions): """ Extracts periods of recessions. Args: recessions: DataFrame containing recession indicators (1 for recession, 0 otherwise). Returns: List of tuples representing start and end dates of recessions. """ recession_periods = [] in_recession = False start_date = None for date, value in recessions["USREC"].items(): if value == 1 and not in_recession: in_recession = True start_date = date elif value == 0 and in_recession: in_recession = False end_date = date recession_periods.append((start_date, end_date)) return recession_periods def plot_median_sales_price_and_mortgage_rates(median_sales_price, mortgage_rates, recession_periods): """ Plots the Median Sales Price of Houses and Mortgage Rates with recession periods. Args: median_sales_price: DataFrame with median sales price data. mortgage_rates: DataFrame with mortgage rate data. recession_periods: List of recession periods (start and end dates). """ fig, ax1 = plt.subplots(figsize=(14, 8)) # Plot median sales price ax1.plot(median_sales_price.index, median_sales_price["Median Sales Price"], color="blue", linewidth=1.5, label="Median Sales Price") ax1.set_xlabel("Year", fontsize=14, labelpad=10) ax1.set_ylabel("Median Sales Price (USD)", fontsize=14, labelpad=10, color="blue") ax1.tick_params(axis="y", labelcolor="blue") ax1.grid(visible=True, which="major", linestyle="--", linewidth=0.5, alpha=0.7) # Add recession periods for start_date, end_date in recession_periods: ax1.axvspan(start_date, end_date, color="gray", alpha=0.3, label="Recession" if start_date == recession_periods[0][0] else "") # Plot mortgage rates ax2 = ax1.twinx() ax2.plot(mortgage_rates.index, mortgage_rates["Mortgage Rates"], color="green", linewidth=1.5, linestyle="--", label="Mortgage Rates") ax2.set_ylabel("Mortgage Rates (%)", fontsize=14, labelpad=10, color="green") ax2.tick_params(axis="y", labelcolor="green") # Combine legends lines, labels = ax1.get_legend_handles_labels() lines2, labels2 = ax2.get_legend_handles_labels() ax1.legend(lines + lines2, labels + labels2, fontsize=12, loc="upper left") # Title and layout plt.title("Median Sales Price of Houses and Mortgage Rates with Recession Periods", fontsize=18, fontweight="bold", pad=20) plt.tight_layout() plt.savefig(save_path, dpi=300, bbox_inches="tight") plt.show() if __name__ == "__main__": try: median_sales_price = fetch_median_sales_price() mortgage_rates = fetch_mortgage_rates() recession_data = fetch_recession_data() recession_periods = get_recession_periods(recession_data) plot_median_sales_price_and_mortgage_rates(median_sales_price, mortgage_rates, recession_periods) except Exception as e: print(f"An error occurred: {e}")

Money Market Funds With Jobless Rates

The chart illustrates the relationship between money market fund assets, the U.S. jobless rate, and recession periods over the past few decades. Historically, sharp increases in money market fund assets (blue line) often coincide with economic uncertainty as investors move towards safer, liquid investments. Simultaneously, the jobless rate (green dashed line) tends to spike during recessions, indicated by the shaded gray areas. For instance, during the 2008 financial crisis and the 2020 COVID-19 pandemic, we observe a surge in money market fund assets and a corresponding rise in unemployment rates. Both indicators reflect investor and consumer fear, as well as economic contraction. ...

Egg Prices Inflation Rates With Recessions

Looks like the CPI has been rising steadily until COVID, then it took off at a higher clip. All this is unsustainable but when will the big correction come? I hate to say it but eggs were cheaper under Trump and all through his Presidency. Granted Biden had to deal with the COVID-19 crisis but after four years he couldn’t bring down the price eggs (and food). ...

Federal Debt With GDP Growth

This chart paints a stark picture of the United States’ fiscal reality. The federal debt, measured as a percentage of GDP, has climbed to concerning levels, nearing 120%. Historically, such high debt-to-GDP ratios have been rare and often signal a tipping point for economic instability. While debt financing can be a useful tool for stimulating growth during downturns, the consistent rise of federal debt beyond sustainable thresholds highlights a deeper systemic issue. Keynesian economic principles advocate for deficit spending to counter recessions, but the persistent reliance on this approach, even in periods of recovery, has led to an erosion of fiscal discipline. ...

Jobless Rate And Household Debt

I generated another economic data mashup, this time looking at the jobless rates vs household debt. It appears there is a weak correlation (my best guess) between the jobless rate and taking on debt. Makes sense, people will borrow more or lived off borrowed money when they lose their jobs. This is one to watch for sure.

Recession Postponed or Should We Be Ready?

The 2-year/10-year spread is what I always look to prepare for a recession. I don’t believe in “soft landings” but I do believe financial chicanery can postpone a recession. With Trump getting back into office he’ll pursue cutting interest rates. That’ll give the economy a jolt in the arm until inflation catches up. So who knows when the recession will happen, but it will. Of course, it’s easy for me to say that a recession will happen after a big Bull Market run, just like it’s easy to say that a Bull Market will happen right after a Bear Market. ...

Thomas Ott

Cocoa is Worth More Than Copper Now

It looks like the price per ton of Cocoa is now about $8,900 whereas Copper is only $8,700-ish. Crazy times but I’m guessing there’s WAY MORE INFLATION IN THE PIPELINE than what we are led to believe. JPOW has to keep it going until after the election. Source Reddit

McDonalds Prices in 1974

Source: Reddit

Restaurants to Try Surge Pricing For Food

Despite the Wendy’s debacle, surge pricing for food was going to get traction. Of course it would, people need to eat and might as well extract as much money from them as possible. Barbecue chain Tony Roma’s and nearly 100 other small restaurants have already turned to fluctuating menu prices during peak times — similar to the rollout planned by fast-food giant Wendy’s next year — according to one company that sells the software specializing in dynamic pricing. ...