Will US Unemployment Be Higher in Three Months?
Forecasting tournaments and prediction markets ask questions like this every week: will a public number be above its latest value on a given date? Answering well means putting a probability on it, and a probability needs a forecast with a range, not a single guess.
The table
The US civilian unemployment rate from FRED: one row per month since January 1948, about 945 rows, with two columns, the date and the rate. It's free to download with no account.
Walkthrough
Download the series
Read FRED's CSV straight into pandas.
import pandas as pd url = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=UNRATE" rate = pd.read_csv(url, parse_dates=["observation_date"])Forecast three months with a range
Ask Chronos-2 for several quantiles, so you can see the whole spread of outcomes.
from welt import Forecast levels = [0.05, 0.1, 0.5, 0.9, 0.95] model = Forecast(model="chronos-2").fit( rate, time="observation_date", target=["UNRATE"], frequency="MS") month3 = model.forecast(3, quantile_levels=levels).to_frame().iloc[-1]Turn the range into a probability
Find where today's rate falls inside the forecast's spread. The share of outcomes above it is the probability of "higher".
import numpy as np today = rate["UNRATE"].iloc[-1] values = [month3[f"q_{q}"] for q in levels] p_higher = 1 - np.interp(today, values, levels) print(f"Chance unemployment is higher in three months: {p_higher:.0%}")
What you get
Try it
Use Open with to run the forecasting notebook in Colab, Kaggle or Jupyter and swap in the FRED series, or run the code above after pip install "welt-client[parquet]".
Open with
- Type
- Use case
- Area
- Finance
- Question
- Will US Unemployment Be Higher in Three Months?
- Model
- Chronos-2
- Data
- FRED civilian unemployment rate (UNRATE), monthly since 1948
- For
- Forecasters, prediction-market traders and journalists
- Licence
- Public domain