Detecting Economic Shifts Before They Become Crises
By Gencay
Published: 2025-10-09
URL: https://www.learnwithmeai.com/p/data-project-7-trend-analysis-on

Economic recessions don’t announce themselves; they leave patterns in the data. Trend analysis helps us spot these patterns before they become crises, turning raw numbers into insights that economists, policymakers, and businesses rely on daily.
In this article, we will use three different techniques to analyze the US unemployment rate from 1948 to 2025 and attempt to predict what’s to come.

As usual, the solution includes code and a slide(above) that were already uploaded to the gDrive, where paid subscribers can access.

What do we offer to the paid subscribers?
Paid subscribers get more than articles; projects with code, custom GPTs, and prompts designed after thousands of hours of experience.
- Last week’s project: Data Project 6: I Analyzed 77,108 NYC Real Estate Sales.
- Last week’s topic: While You’re Using GPT-5, The Game Changed: Meet the Claude Sonnet 4.5!
- Last week’s AI Pulse:Weekly AI Pulse #110, California Just Changed AI Forever!
Understanding the US Unemployment Rate Dataset
The unemployment rate measures the percentage of people actively seeking work but unable to find employment. It’s one of the most watched economic indicators because it directly reflects the health of the labor market and the broader economy.
Our dataset originates from the Federal Reserve Economic Data (FRED), which the St. Louis Federal Reserve Bank maintains.
It contains monthly observations of the US unemployment rate spanning from January 1948 to August 2025, that’s 77 years.

Data Exploration
Let’s load the data and see what we’re working with. Here is the first glance at our dataset.

The dataset is clean and simple. Two columns: date and unemployment rate. No missing values, no messy formatting. This is exactly what you want for time series analysis.
Let’s see the range and the statistics of the data.

What does it tell us? The rate reached a maximum of 14.8 and a minimum of 2.5. Let’s visualize a little bit of the pure data, right?

Wow, look at the spike after 2018; that sudden surge clearly aligns with the COVID-19 pandemic. Lockdowns and business closures sent unemployment soaring to record highs before stabilising again as the economy reopened.
Technique 1: Year-over-Year Change Rate (Detecting Momentum)
Year-over-Year (YoY) change measures how much unemployment has increased or decreased compared to 12 months ago. It’s not the unemployment rate itself; it’s the speed of change.
Think of it like velocity. The unemployment rate tells you where you are. YoY change tells you how fast you’re moving. If unemployment is 5% today and was 4% last year, your YoY change is +1 percentage point. That positive number is a warning sign; things are getting worse.
This technique is powerful because it shows acceleration before it becomes obvious. When YoY change turns positive and keeps climbing, a recession usually starts. When it turns negative and continues to fall, recovery is underway.

The bottom chart tells the real story.
Red vs. Green zones: When the line crosses above zero (red), unemployment is rising. Below zero (green)? It’s falling. The zero line separates good times from bad times.
The recession spikes: Look at those red mountains. Every major economic crisis jumps off the page: the early 1950s, the mid-1970s, the early 1980s (the brutal one), 2008-2009, and the monster COVID spike, hitting +11 percentage points in 2020.
The warning pattern: Here’s the key insight. Before every spike, the line doesn’t teleport from -2 to +4. It creeps. Zero becomes +0.5. Then +1.0. Then it accelerates. That gradual climb above zero? That’s your alarm bell ringing.
Recovery valleys matter too: After every red spike comes a green valley as unemployment drops back down. The 2020 COVID recovery was historic—plunging from +11 to -9 in just two years. The fastest bounce-back we’ve ever seen. Compare that to 2008’s sluggish recovery, where the green valley stayed shallow for years.
Where we are now: Current YoY change sits at +0.10 percentage points. Barely positive. Unemployment is 0.1% higher than last year—essentially flat. This isn’t a warning signal yet.
What to watch for: If +0.10 becomes +0.30 next month, then +0.50 the month after? That’s acceleration. That’s when you worry. But right now we’re hovering at zero. Stable. Not falling, not surging. Just coasting.
Bottom line: +0.10 is a yellow light, not red. Keep watching. If it climbs past +0.5 and keeps climbing, a recession is probably starting. For now? Neutral territory.
Technique 2: Volatility Analysis (Measuring Uncertainty)
Volatility measures how much unemployment bounces around over time. Low volatility means stability, and unemployment changes slowly and predictably. High volatility means chaos, big swings, rapid changes, and uncertainty.
We calculate this using a 12-month rolling standard deviation. Think of it as a “shakiness meter” for the labor market. When the economy is healthy, the meter sits low. When a crisis hits, it spikes.
Here’s the key insight: volatility often rises before recessions become obvious. Markets get jittery. Unemployment starts jumping month to month instead of moving smoothly. That uncertainty is your early warning signal.

The volatility spikes tell the recession story: Look at the bottom chart. Every red mountain is a crisis. The 1950s had several small spikes. The 1970s oil shocks created sustained volatility. The early 1980s recession shows a clear spike. 2008 brought another surge as the financial system collapsed.
But nothing compares to COVID: That 2020 spike explodes off the chart, hitting 4.5, nearly 12 times the current level. Unemployment went from 3.5% to 14.8% in one month, then crashed back down. The labor market had never seen anything like it. Pure chaos.
The orange threshold line matters: This marks the 75th percentile—the level where volatility becomes “high risk.” When the red line crosses above the orange, trouble is brewing. Notice how most recession periods push above this line.
Current status is remarkably calm: Today’s volatility sits at 0.080, well below the historical average of 0.375. We’re not just stable, we’re exceptionally stable. The labor market is moving predictably, no wild swings, no panic.
Top 5 most volatile periods: All five come from 2020. COVID dominated the volatility rankings completely. The second-place period (2008) doesn’t even come close.
What this means for recession prediction: Low volatility now suggests no immediate crisis. If volatility suddenly jumps above 0.4, pay attention. If it crosses 1.0, a recession is likely underway or about to start.
Bottom line: Volatility is a fear gauge. Right now, it’s asleep. The labor market is boring—and boring is good. Watch for sudden spikes above the threshold. That’s when you should worry.
Technique 3: Change Point Detection (Finding the Breaking Points)
Change point detection finds the exact moments when unemployment trends shift direction. It’s not about gradual changes—it’s about structural breaks. The points where the economy fundamentally changes course.
Think of it like a car changing gears. Most of the time, you’re accelerating or decelerating smoothly. But sometimes you hit the brakes hard or floor the gas pedal. Those sudden shifts are change points.
We’re looking for two types:
- Recession starts (red): When unemployment suddenly begins rising
- Recovery starts (green): When unemployment reverses and begins falling
This technique answers a simple question: “When did things actually change?”

The major turning points are crystal clear: The algorithm detected six critical moments in 77 years. That’s one major shift every 13 years on average. These aren’t small bumps; these are the moments that defined decades.
Red markers = recession starts:
- 1949: Post-WWII adjustment, unemployment jumped from 3.4% to over 6%
- 1953: Korean War ends, defense spending drops
- 1957: The “Eisenhower recession” hits manufacturing
- 1974: Oil crisis destroys the economy, unemployment surges from 5% to 9%
- 2008: Financial crisis—the Great Recession begins at 6.7% and climbs to 10%
- 2019: COVID lockdowns sent unemployment to 14.8% in weeks
Green markers = recovery starts: Only one green marker appears: 2020 recovery. Why just one? Because our threshold is set high, we’re only catching the most dramatic reversals. COVID’s recovery was so fast and so sharp that it qualified as a major structural break.
Future Plan: Automated Recession Detection System
What if you didn’t have to check these charts manually? What if the system watched for you 24/7 and only alerted you when something actually mattered?
The idea: Set up an automated monitoring system using n8n (a workflow automation tool) that:
- Downloads fresh unemployment data from FRED every month
- Runs all three techniques automatically
- Calculates risk scores based on thresholds we defined
- Sends Slack alerts only when warning signals appear
Every 1st of the month:
↓
Download FRED data via API
↓
Run Python analysis:
- Calculate YoY change
- Calculate volatility
- Detect change points
↓
Check thresholds:
- YoY > +0.5? 🟡 Yellow alert
- YoY > +1.0? 🔴 Red alert
- Volatility > 0.4? 🟡 Yellow alert
- Volatility > 1.0? 🔴 Red alert
- New change point detected? 🔴 Red alert
↓
If any alerts triggered:
→ Send Slack message with charts
→ Include current values and trends
→ Add context: “Recession risk elevated”
Else:
→ Send brief status: “All clear, no action needed”
Why this matters: You don’t need to obsessively check dashboards. The system does the boring work. You only hear from it when something changes. No noise, just signal.
Expanding beyond three techniques: Once the foundation is built, you can add more indicators:
- GDP growth rate
- Initial jobless claims (weekly)
- Consumer confidence index
- Stock market volatility (VIX)
- Yield curve inversion
- Manufacturing PMI
- Retail sales growth
Run 50+ techniques, combine their signals, and get a single “recession risk score” every month. Let the automation handle the heavy lifting.
The Slack message would look like:
🟡 UNEMPLOYMENT ALERT - December 2025
Year-over-Year Change: +0.6% (above threshold)
Volatility: 0.35 (normal)
Change Points: None detected
Status: CAUTION - Watch closely next month
Recommendation: Monitor for acceleration
📊 View full report: [link to dashboard]
Note: This analysis is for informational purposes only and does not constitute financial advice.
Final Thoughts
The US unemployment rate tells the story of an entire economy in one number. We used three techniques to decode that story: YoY change for momentum, volatility for panic signals, and change points for structural breaks.
Currently, all three say the same thing: stability, with no red flags.
But the real power isn’t in today’s analysis; it’s in automating this process so you catch the next recession before it catches you. Let me know if one of you decides to do this N8N automation, so I’ll share the SS in the Substack notes and publish our ideas to the world.