AI Stock Monitor
Home · Hot Events · Methodology

Methodology · Historical Analogs + Monte Carlo

This page explains the data sources, math, and uncertainty bounds behind every topic page. The full source code is on GitHub, every event in our list cites a primary source, and you're welcome to cross-check anything below.

What's a historical analog?

The core idea: a current event may have no exact precedent, but the category it belongs to (geopolitical flare-ups, central bank pivots, oil shocks, …) has played out many times in the past 30 years. The cross-asset moves after each one form an empirical distribution. We use that distribution to answer "what does it usually do, and how wide is the spread?"

This is not "fit a model and project a mean." We do not assume returns are normally distributed, we do not point-forecast a drift, and we do not rely on any parametric assumption. The samples are the inference.

How each topic page is built

The bottom of every topic page lists every historical event used to build it. Each event carries:

For each asset (SPY / GLD / TLT / etc.) we precompute its total return (with dividends reinvested) at T+1, T+5, and T+30 trading days after the event.

The "median" you see on a page is the 50th percentile of those samples; the "range" is p10 to p90.

When sample sizes are small, the tails of the distribution aren't trustworthy. Topic pages with n < 5 samples display a "sample too small — directional only" warning.

Portfolio P&L estimate: joint-sampling Monte Carlo

This is the math behind "type your positions, see a P&L range" on each topic page.

How it works:

for sample in range(1000):
    # Pick one historical event uniformly at random (with replacement)
    event = random.choice(historical_events)

    # All asset T+30 returns FOR THAT EVENT, as one complete vector
    return_vector = event.returns  # {SPY: +0.041, GLD: +0.024, TLT: -0.012, ...}

    # Your portfolio P&L = position weights · per-asset returns
    portfolio_pnl = sum(weights[t] * return_vector[t] for t in tickers)

# 1000 trials → take p10 / p50 / p90 as the displayed range

The key point: joint sampling (whole-vector draws)

Each Monte Carlo trial draws one historical event, and every asset's return for that single event is used together in the trial. This automatically preserves the cross-asset correlations that actually showed up.

The wrong alternative — call it "per-ticker independent sampling" — would draw SPY's return from one event, GLD's return from a different event, TLT's return from a third event, and so on. That approach incorrectly assumes the assets are uncorrelated.

Why this matters: SPY and QQQ have a historical correlation around 0.95. In crisis windows, SPY-vs-GLD flips from roughly −0.1 to +0.4. Independent sampling would tell you these assets diversify each other when in reality they sell off together. Joint sampling never makes that mistake.

Why not Cholesky decomposition?

Cholesky is the textbook way to back out correlated samples from a correlation matrix — but it requires you to assume returns are multivariate normal. Crisis-window returns are fat-tailed, asymmetric, and frequently jumpy; the normal assumption systematically under-prices the tails. Joint sampling skips that entirely. We use the historical samples directly. The fat tails come along for free.

Data sources

What this tool does not do

Sample size vs. uncertainty

More samples means more reliable percentile estimates. Rough guidelines:

The pill row at the top of each topic page shows the sample count so you can calibrate confidence at a glance.

Open + verifiable

The full event list, asset data, and calculation logic live in github.com/samque1983/ai-monitor. If you spot a wrong date, a misclassified event, or want to add a new event category, pull requests are welcome.

© AI Stock Monitor · This page is informational and does not constitute investment advice.
Back to Hot Events index