CMH MATH PATH — LESSON 6: TIME SERIES ANALYSIS

Predicting the Future by Listening to the Echoes of the Past


PART 1: THE CORE IDEA — SOCIETY HAS MEMORY

Yesterday’s Weather Predicts Today’s

Think about the weather:

  • If it’s sunny today, what’s likely tomorrow? Probably sunny.
  • If it’s raining today, what’s likely tomorrow? Probably rainy.

The weather has momentum. Social systems do too!

CMH Examples:

  • Good economic times tend to continue (momentum)
  • Protests often lead to more protests (contagion)
  • Peaceful countries tend to stay peaceful (stability)
  • After a revolution, risk of another revolution is HIGH (volatility)

Time series analysis is how we measure and predict this momentum.


PART 2: THE THREE COMPONENTS OF ANY TIME SERIES

Take any data over time (like monthly unemployment rate):

Unemployment (%)
    ↑
  10 |    •       •               •       •
     |  •   •   •   •   •   •   •   •   •   •
   9 | •     • •     • •     • •     • •     •
     |
   8 |•     •         •     •         •     •
     |
   7 +-----------------------------------------→ Time (Months)
     J F M A M J J A S O N D J F M A M J J A S

Every time series has three ingredients mixed together:

1. Trend (Tₜ): The Long-Term Direction

  • Upward: Population growth, technological progress
  • Downward: Poverty reduction, disease eradication
  • Flat: Stable systems

Example: Global temperature (upward trend), Child mortality (downward trend)

2. Seasonality (Sₜ): The Predictable Cycles

  • Yearly: Unemployment (higher in winter), Retail sales (Christmas spike)
  • Monthly: Payday spending surges
  • Weekly: Weekend protests more common
  • Daily: Social media activity peaks at night

Example: “Arab Spring” protests often start in spring (weather better, students free)

3. Random Noise (εₜ): The Unexplained Jumps

  • Unexpected events
  • Measurement error
  • Pure randomness

The Full Equation:

Yₜ = Tₜ + Sₜ + εₜ
(Data at time t = Trend + Seasonality + Noise)

Our goal: Separate these ingredients!


PART 3: AUTOCORRELATION — MEASURING “MEMORY”

How Today Correlates with Yesterday

Autocorrelation = Correlation of a series with ITSELF at different time lags.

Lag-1 Autocorrelation: How today correlates with yesterday
Lag-7 Autocorrelation: How today correlates with last week
Lag-365 Autocorrelation: How today correlates with last year (for daily data)

Example: Daily Protest Size

  • Lag-1 autocorrelation = 0.7 (high!) → Yesterday’s protests predict today’s
  • Lag-7 autocorrelation = 0.3 (medium) → Last week matters somewhat
  • Lag-30 autocorrelation = 0.1 (low) → Last month doesn’t matter much

Interpretation: Protests have short memory (1-2 weeks), not long memory.

Visualizing Autocorrelation: The “Lag Plot”

Plot today (Yₜ) vs. yesterday (Yₜ₋₁):

Today's Protest Size
    ↑
 500|         •      •             Strong positive
    |      •     •      •          autocorrelation!
    |   •    •     •      •
 300| •   •     •     •     •
    |•  •    •     •     •
    |• •   •     •     •
 100|••   •     •     •
    +---------------------→ Yesterday's Protest Size
    100   300   500

If dots form upward pattern → High autocorrelation (memory!)
If dots form cloud → No autocorrelation (no memory)


PART 4: THE ARIMA MODEL — THE WORKHORSE OF TIME PREDICTION

The Three Letters Explained

ARIMA(p,d,q) has three parts:

1. AR(p) — AutoRegressive (p = how many past values matter)

  • AR(1): Today = a × Yesterday + noise
  • AR(2): Today = a₁×Yesterday + a₂×DayBeforeYesterday + noise
  • Meaning: “The past directly influences the present”

2. I(d) — Integrated (d = how many differences to make it stationary)

  • I(0): Use raw data (already stable around mean)
  • I(1): Use changes from one period to next (difference once)
  • Why? Many series have trends; differencing removes trends!

3. MA(q) — Moving Average (q = how many past shocks matter)

  • MA(1): Today = average + b × Yesterday’sRandomShock
  • MA(2): Today = avg + b₁×Yesterday’sShock + b₂×DayBefore’sShock
  • Meaning: “Random events have lingering effects”

ARIMA(1,1,1) in English:
“Today’s CHANGE from yesterday depends on:

  1. Yesterday’s CHANGE (AR part)
  2. Yesterday’s RANDOM SHOCK (MA part)
    And we’re modeling CHANGES, not levels (I=1)”

PART 5: HANDS-ON TIME SERIES LAB

Exercise 1: Detect Seasonality in Unemployment

Monthly US unemployment data (simplified):

Month: J F M A M J J A S O N D J F M...
Rate:  6 6 5 5 4 4 5 5 5 5 6 6 6 6 5...

Your task:

  1. Plot the data
  2. Do you see yearly pattern? (Higher in winter?)
  3. Calculate 12-month difference: Jan2024 – Jan2023
  4. Calculate 1-month difference: Feb2024 – Jan2024

Insight: The 12-month difference removes seasonality! The 1-month difference shows momentum.

Exercise 2: Build a Simple AR(1) Model

Data: Daily protest count for 30 days:

Day:  1  2  3  4  5  6  7  8  9 10...
Count:50 55 60 58 62 65 68 70 72 75...

AR(1) Model: Protestₜ = α + β×Protestₜ₋₁ + εₜ

Estimate β (autoregressive coefficient):

  1. Calculate correlation between Day2-30 and Day1-29
  2. Rough approximation: β ≈ correlation ≈ 0.9 (high momentum!)

Make prediction for Day 11:
If Protest₁₀ = 75, then:
Protest₁₁ ≈ α + 0.9×75 ≈ constant + 67.5

Interpretation: Protests show strong momentum (0.9). Each day continues 90% of previous day’s energy!

Exercise 3: The “Difference” Trick

Problem: GDP grows steadily (trend). Hard to model.

Solution: Model GDP growth rate (percentage change), not GDP level.

Data (GDP in trillions):

Year: 2000 2001 2002 2003 2004
GDP:  10.0 10.3 10.5 10.8 11.0

Calculate growth rates:

  • 2001: (10.3-10.0)/10.0 = 3.0%
  • 2002: (10.5-10.3)/10.3 = 1.9%
  • 2003: (10.8-10.5)/10.5 = 2.9%
  • 2004: (11.0-10.8)/10.8 = 1.9%

Now model growth rates (more stable!) instead of GDP levels.

This is Integration (I) in ARIMA! We differenced once (I=1).


PART 6: CMH CASE STUDY — THE BUSINESS CYCLE

Predicting Recessions with Time Series

Key economic indicators:

  1. Yield Curve: 10-year minus 2-year interest rates
  2. Unemployment Rate
  3. Consumer Confidence
  4. Stock Market Returns

The Time Series Pattern: These indicators turn downward BEFORE recessions!

Leading vs. Lagging Indicators:

  • Leading: Turn BEFORE economy (yield curve, building permits)
  • Coincident: Turn WITH economy (GDP, employment)
  • Lagging: Turn AFTER economy (unemployment duration, inflation)

CMH Application: Build ARIMA model for yield curve → Predict recessions 12-18 months ahead!

Historical fact: Yield curve inversion (short rates > long rates) has predicted last 8 recessions!


PART 7: VECTOR AUTOREGRESSION (VAR) — WHEN EVERYTHING AFFECTS EVERYTHING

The Multi-Variable Time Series

Real CMH: Many variables interact!

Example: Protests, Police response, Media coverage, Government approval

VAR Model: Each variable depends on past values of ALL variables!

Simplified 2-variable VAR(1):

Protestₜ = a₁₁×Protestₜ₋₁ + a₁₂×Policeₜ₋₁ + ε₁ₜ
Policeₜ  = a₂₁×Protestₜ₋₁ + a₂₂×Policeₜ₋₁ + ε₂ₜ

Interpretation:

  • a₁₂ = How yesterday’s police presence affects today’s protests
  • a₂₁ = How yesterday’s protests affect today’s police deployment

CMH Insight: This captures feedback loops!

  • More protests → More police → Fewer protests? (Maybe!)
  • More police → More anger → More protests? (Maybe!)

Impulse Response Analysis: Shock one variable → See how ALL variables respond over time

Example: Shock to “Oil price” → Watch effects on: Inflation → Protest → Government approval → Policy change…


PART 8: THE REVOLUTION CYCLE — SECULAR CYCLES

Peter Turchin’s “Secular Cycles”

Historical data shows 200-300 year cycles in empires:

Phase 1: Expansion

  • Population grows
  • Territory expands
  • Living standards rise
  • 50-100 years

Phase 2: Stagflation

  • Population too large
  • Resources strained
  • Inequality grows
  • 50-100 years

Phase 3: Crisis

  • State collapse
  • Civil war
  • Population decline
  • 20-50 years

Phase 4: Intercycle

  • Recovery begins
  • 20-50 years

Time series evidence: Archaeological records, grain prices, wage data, conflict records over centuries show these long waves.

Current position: According to Turchin, US/world in late stagflation → approaching crisis phase.


PART 9: YOUR TIME SERIES FIELD KIT

Quick Diagnosis Guide

Look at your time series plot. Ask:

  1. Trend? Up, down, or flat?
  2. Seasonality? Regular yearly/monthly/weekly patterns?
  3. Cycles? Longer irregular waves (5-10 years)?
  4. Outliers? Sudden spikes/drops?
  5. Changing variance? Calm periods then volatile periods?

Then choose model:

  • Trend + seasonality → SARIMA (Seasonal ARIMA)
  • Multiple interacting variables → VAR
  • Long memory (effects decay slowly) → FARIMA (Fractional ARIMA)
  • Sudden regime changes → Markov Switching model

The Prediction Horizon Rule

How far ahead can we predict?

  • Weather: 1-10 days (chaotic)
  • Economy: 1-4 quarters (momentum + cycles)
  • Demographics: 10-50 years (births today → adults in 20 years)
  • Climate: 10-100 years (slow-moving systems)
  • Social unrest: 1-12 months (momentum + triggers)

Key insight: Predictability depends on dominant time scale of system!


PART 10: HANDS-ON CMH FORECAST PROJECT

Build a 6-Month Protest Forecast

Step 1: Get data (or make realistic synthetic data):

  • Daily protest count (last 2 years)
  • Daily unemployment rate
  • Daily social media unrest mentions
  • Daily government approval rating

Step 2: Clean data

  • Handle missing days (weekends, holidays)
  • Remove outliers (typos, measurement errors)
  • Create “protest” variable: 1 if >1000 protesters, 0 otherwise

Step 3: Explore

  • Plot each series
  • Calculate autocorrelations
  • Check cross-correlations (does unemployment lead protests by 1 month?)

Step 4: Build model

  • Start simple: AR(1) for protest probability
  • Add: Do unemployment shocks increase protest probability next month?
  • Try: VAR with protest and unemployment

Step 5: Forecast

  • Train on first 18 months
  • Test on last 6 months
  • Compare predictions to actual
  • Calculate accuracy: % of correct “protest/no protest” predictions

Step 6: Interpret

  • What’s the “memory length” of protest momentum?
  • Do economic shocks take 1-2 months to trigger protests?
  • What’s the baseline protest probability?

YOUR MATH HOMEWORK

Exercise 1: The “Momentum” Calculation

Data: Monthly riot count in a region:

Month:  M1  M2  M3  M4  M5  M6  M7  M8
Riots:   2   3   5   8  12  10  15  20
  1. Calculate 1-month differences: M2-M1, M3-M2, etc.
  2. Calculate autocorrelation of these differences
  3. If autocorrelation = 0.6, what does that mean?
  4. Predict M9 using simple AR(1): Riotₜ = 0.6×Riotₜ₋₁ + constant
  5. Insight: Does unrest show momentum? How strong?

Exercise 2: Separate Trend, Seasonality, Noise

Data: Monthly unemployment with trend + yearly seasonality:

Month: J F M A M J J A S O N D J F M...
Year1: 6 6 5 5 4 4 5 5 5 5 6 6 6 6 5...
Year2: 5 5 4 4 3 3 4 4 4 4 5 5 5 5 4...

Note: Trend is downward (improving economy), seasonality is winter highs.

Your tasks:

  1. Estimate trend: Average each year (Year1=5.0, Year2=4.0)
  2. Remove trend: Subtract yearly average from each month
  3. Estimate seasonality: Average each month across years
  • Jan: (6-5 + 5-4)/2 = (1+1)/2 = 1.0
  • Jul: (5-5 + 4-4)/2 = 0.0
  1. What’s left? (Noise!)
  2. Forecast: Next January = Trend(3.0?) + Seasonality(1.0) = 4.0%

Exercise 3: The “Granger Causality” Test

Question: Does unemployment CAUSE protests (with time lag)?

Method:

  1. Model 1: Protestₜ = f(Protestₜ₋₁, Protestₜ₋₂)
  2. Model 2: Protestₜ = f(Protestₜ₋₁, Protestₜ₋₂, Unempₜ₋₁, Unempₜ₋₂)
  3. If Model 2 predicts significantly better → Unemployment Granger-causes protests

Your task: With made-up data, calculate:

  • Can yesterday’s unemployment improve today’s protest prediction?
  • What lag works best? 1 month? 2 months?

Exercise 4: Design a CMH Early Warning System

You’re building system to predict state collapse risk for 100 countries.

Available: Yearly data for 50 years:

  • GDP growth
  • Internal conflict deaths
  • Government corruption index
  • Trade openness
  • Neighborhood instability

Design:

  1. What time series model? (ARIMA, VAR, other?)
  2. How handle countries with different histories? (Some 50 years data, some 20)
  3. What prediction horizon? (1 year? 5 years?)
  4. How update as new data arrives?
  5. How communicate uncertainty? (Range of possible futures)

Special challenge: How detect change points — when a country shifts from stable to unstable regime?


KEY TAKEAWAYS:

  1. Time matters — Yesterday affects today
  2. Three components: Trend + Seasonality + Noise
  3. Autocorrelation measures “memory”
  4. ARIMA models capture momentum
  5. VAR models capture interactions
  6. Differencing removes trends
  7. Leading indicators warn of coming changes
  8. Cycles exist at multiple time scales

The CMH Mantra:

“Linear regression asks: What’s related?
Time series asks: What happens next?
Societies don’t reset each day like dice; they carry yesterday’s momentum into today.
Revolutions don’t erupt from nothing — they simmer for months, showing small tremors before the quake.
The future isn’t a random draw from a hat; it’s the next frame in a movie already playing.
Our job is to watch the film and guess what happens next.”


NEXT LESSON PREVIEW:

Lesson 7: Network Theory — The Hidden Web of Society

Where we’ll learn:

  • How connections matter more than individuals
  • Six degrees of separation — mathematically real!
  • Why ideas, diseases, and revolts spread like wildfires
  • Centrality measures: Who are the most influential people/groups?
  • Small world networks: Why society is both clustered and connected

Thought to Ponder: Time series assumes society moves through time like a river flowing. But rivers have channels — some connections allow fast flow, others are dead ends. Network theory maps these channels. Combined with time series, we get: Who is connected to whom, and how do influences flow through those connections over time? This is where CMH becomes truly powerful — predicting not just when, but where and how things will spread.


Remember: In CMH, the past isn’t just prologue — it’s active memory. Societies traumatized by war fear war more. Economies that have grown steadily expect more growth. This memory creates momentum, and momentum creates predictability. But beware: systems can have multiple memories at different time scales — the daily news cycle, the electoral cycle, the generational cycle, the civilizational cycle. Each has its own rhythm, and when they synchronize… that’s when history accelerates.

Similar Posts