Forecast whether something will happen next period (a stockout, a sell-out, a target hit) from what
happened last period and what you plan to do, then test that forecast on days it never saw.
π¨βπ« Professor Mode: Guided Learning Experience
New to yes/no forecasting? Professor Mode walks you through momentum, honest testing and the
difference between a one-day effect and a lasting one.
QUICK START: Choose Your Path
OVERVIEW & WHAT THIS TOOL SOLVES
Imagine a grocery category manager paying $180/week for a third oat-milk delivery because the shelf runs out roughly one day in sixβand once empty, it tends to stay empty until the next truck arrives. A stockout you see coming is a delivery you can move; one you miss is a lost sale. Standard time-series tools like ARX assume continuous numbers, while standard logistic regression ignores time order. Dynamic Logistic Regression forecasts a single yes/no time series by placing yesterday's 0/1 outcome directly alongside external drivers (like promotions, weather, or deliveries) and testing forecasts on a strict walk-forward holdout.
π― Questions It Answers
How sticky is our yes/no outcome from one period to the next (state-dependence / momentum odds ratio)?
Do our operational or marketing drivers genuinely shift the event probability once we control for yesterday's outcome?
Does our model beat the tough "Same as Yesterday" baseline, especially on the crucial days when the outcome switches?
π What Data You Need
Single Time-Ordered Series CSV: One row per time period (day, week, month) in chronological order (for multi-customer panels, use Panel Dynamic Logit).
1 Binary Outcome Column (yt): Coded 0/1 or two labels (e.g., stockout, sold out, daily goal hit).
External Driver Columns (xj,t): Numeric or 0/1 predictors with selectable lag delays.
π‘ What You'll Discover
Momentum vs. Driver Odds Ratios: Separate odds ratios for lagged outcomes (eΟ) and external levers (eΞ²).
Walk-Forward Holdout Scorecard: Out-of-sample accuracy, log loss, and Switch-Day accuracy against three baselines.
Short-Run vs. Long-Run Steady-State Lift: How a one-day intervention differs from sustaining a policy permanently.
π Key Nuances: Why Yesterday Matters, Walk-Forward Testing & When Not to Use This Tool
Not the Same "AR" as ARX: The ARX tool carries past continuous errors forward. Because a 0/1 binary outcome has no continuous error to carry forward, Dynamic Logit enters past outcomes (ytβ1, β¦, ytβp) directly as predictors in logistic regression.
Leaving Yesterday Out Can Flip a Driver's Sign: If managers react to bad days (e.g., ordering emergency stock or running a promo after a slump) and you omit yesterday's outcome, the model blames the manager's reaction for the bad state that triggered it.
Beat "Same as Last Period" on Switch Days: In a sticky series, guessing "same as yesterday" is right on most quiet days but gets 0% of switch days right. Always evaluate the model on walk-forward holdout periods and inspect Switch accuracy.
When to Use Another Tool: Don't turn a continuous metric (like dollar sales) into a 0/1 thresholdβforecast the number directly with ARX. And if your file stacks many customers' histories together, use Panel Dynamic Logit.
π Under the Hood: Model Equations & Variable Definitions
π¬ Read it in plain English:The log-odds that the event happens in period t equals a baseline intercept (Ξ±), plus momentum from the last p outcomes (Οi ytβi), plus the effects of external drivers at their chosen lag delays (Ξ²j xj,tββ).
Pt, yt
Predicted Event Probability & Observed 0/1 OutcomeOUTPUT β
Chance the focal event happens in period t (Pt) and actual binary outcome (yt β {0, 1}).
Value of external driver j at delay βj and its log-odds slope Ξ²j holding past outcomes fixed.
Ξ±, p, βj
Baseline Intercept, Autoregressive Order & Driver DelayYOUR DATA β
Baseline log-odds when all lags and drivers are zero (Ξ±), number of outcome lags included (p), and chosen delay for driver j (βj).
Step 1DATA SOURCE
Start with a case: each one was generated from a known model, so at the end you can check your estimates
against the truth. Or bring one series of your own, one row per period, in time order.
π
Use a Case Study
Four cases, each two years of daily data: a grocery shelf that keeps running out, delivery slots
that sell out in streaks, a candle shop whose flash sales look like failures, and the same grocery
shelf after a supplier switch.
πUse a Case Studyclick to switch
π€
Upload Your Data
Drag & Drop raw data file (.csv, .tsv, .txt)
One row per period, in time order: a yes/no outcome column, optional
predictor columns, and an optional date column. At least 60 periods.
No file uploaded.
π€Upload Your Dataclick to switch
INPUTS & SETTINGS
Step 2Tell the model what to look at
Pick the yes/no outcome and which of its two values counts as "yes". Then pick the drivers. A driver
used in the same period has to be something you will know in advance when you forecast: a
planned promo, a delivery schedule, a weather forecast.
Dates unlock day-of-week terms and real dates on the forecast.
Drivers, and how long each one takes to act
Tick a driver to include it. "Same period" means today's value forecasts today; "1 period
later" means yesterday's value forecasts today.
Driver
Same period
1 period later
2 periods later
3 periods later
Load data to see its columns.
Step 3Decide how far back the memory reaches
"Outcome lags" is how many past periods the model may look at. One lag means "was it out of stock
yesterday?". Two adds the day before. Start with one and let the lag table under the results tell you
whether more help.
Advanced
π€ Try this:
Load Kestrel Market, set outcome lags to 0, and run. Open Diagnostics and look at
the bar at lag 1 in the leftover-pattern chart.
Set outcome lags back to 1 and run again. Watch that bar shrink, and watch what
happens to the delivery effect.
Now load Brightwick Candles and do the same thing. Keep an eye on the sign of the flash-sale
coefficient.
Load a case or upload a
series to begin.
Step 4VISUAL OUTPUT
Every number on this page about forecasting comes from the held-back periods: days the model was never
fitted to. That is the only honest way to score a forecast.
The series, and how the model saw it coming
Each tick along the bottom is a period when the outcome happened. The line is the model's forecast
chance for each period; in the shaded stretch at the end, every point is a genuine forecast made
without seeing that day. Diamonds mark the switches, the days the outcome changed.
π How to Read This Chart
A tall line just before a tick means the model saw that day coming.
In a sticky series the line hugs whatever happened yesterday. That is momentum, and it is why the
switches matter more than the long quiet stretches.
A diamond with a high line before it (or a low line before a "no") is a switch the model caught.
Did it beat doing the obvious thing?
Lower is better. Each bar is the average penalty for the held-back forecasts: a confident miss costs a
lot, a hedge costs a little. The model has to beat "momentum only" to show its drivers add anything,
and the dashed line (the base rate) to show anything forecasts at all.
π How to Read This Chart
Shorter bar, better forecasts. The gap between the model and "momentum only" is what your
drivers bought you.
"Same as last period" has no bar: it only ever says 0% or 100%, and one confident miss makes this
penalty infinite. It appears in the table below instead.
Accuracy rewards saying the same thing as yesterday. Switches caught is the column that shows
whether the model sees change coming.
Forecast
Log loss
Brier
AUC
Accuracy
Switches caught
What each driver does today, and if you keep it up
Bars are changes in the chance of a "yes", in percentage points. The first two bars per driver are its
effect today, split by what happened the period before; the third is how far the long-run share of
"yes" periods would move if the driver were on in every single period, the most extreme lasting change.
π How to Read This Chart
When the two "today" bars differ a lot, the driver matters far more on some days than others.
That is what momentum does to an effect.
The long-run bar is an upper bound, not a plan: nobody runs a promotion every day. Price a
realistic lasting change (a delivery every Saturday) in the what-if below. The today bars are for
one-off decisions.
These are associations from past data, not proof that the driver causes the change.
Step 5WHAT THIS MEANS
Start with the plain reading, then the two write-ups. The numbers below are the ones to quote.
Does yesterday change today's chances?
–
Outcome-lag odds ratio
Run the analysis to see what this means here.
Do the drivers add anything beyond momentum?
–
Holdout log loss vs momentum only
Does it see changes coming?
–
Switches caught
If things carried on as they are, how often would it happen?
–
Long-run rate
Start here
Managerial Interpretation
Run the analysis to see the managerial interpretation.
APA-Style Report
Run the analysis to see the APA-style report.
MODEL DETAILS
Coefficient Estimates (Log-odds and Odds Ratios)
Term
Estimate (log-odds)
Standard Error
z
p-value
Odds Ratio
Odds-ratio interval
Periods used (after lags):–
Log-likelihood:–
Model chi-square vs intercept only:–
McFadden R-squared:–
AIC / BIC:–
π How to Read This Table
The outcome-lag row is the momentum. Its odds ratio says how many times higher the odds of a
"yes" are after a "yes", with the drivers held fixed.
A driver's odds ratio is its association with last period's outcome held fixed. If the interval
includes 1, this data cannot tell the driver apart from no association.
Odds ratios multiply odds, not probabilities. The effects chart above turns them into percentage
points.
How far back does the memory go?
The same model with 0 to 4 outcome lags, every row fitted on the same periods so the scores compare
fairly. Lower AIC and BIC are better; the highlighted row is BIC's choice. The tool never switches
your setting for you.
Outcome lags
Periods
AIC
BIC
Last lag adds anything? (LR p)
Step 6FORECAST & WHAT-IF
Set what each driver will do over the coming periods, then compare a plan against carrying on as before.
A same-period driver only belongs here if you will know it in advance.
π Scenario builder
"As before" replays each driver's last year in order, so promotions keep their usual
rhythm. The what-if column is the plan you want to test.
Driver
Baseline
What-if
The next periods, as probabilities
The solid line is the chance of a "yes" each coming period under the baseline, the dashed line under
your what-if. The faint dots are twenty possible futures drawn from the same model: a 30% day comes up
"yes" about one time in three.
π How to Read This Chart
The line starts from what happened last period and drifts toward the long-run rate as the memory
of today fades.
These probabilities treat the fitted coefficients as exact. With a couple of years of history the
real uncertainty is wider.
The long-run rates below are exact consequences of the model, not simulations.
Long-run rate, baseline:–
Long-run rate, what-if:–
REVEAL THE TRUTH
This case was generated from a model with known coefficients. Make your call first, then compare.
DIAGNOSTICS & ASSUMPTIONS
Each check below says what it found and what to do about it. A failed check is a next step, not a
verdict on the data.
Is there time pattern left over?
Bars are how much each period's surprise resembles the surprise k periods earlier. Bars inside the
dashed band are noise; a bar sticking out at lag 1 means the model is missing some of yesterday.
π How to Read This Chart
The Ljung-Box test below the bars asks whether all the bars together stick out more than chance
would allow. It was built for numeric residuals, so for yes/no data read it as approximate.
Has the rate held steady?
The share of "yes" periods over the trailing four weeks. A model fitted to two years assumes the
same rules held throughout; a step in this line is a reason to doubt that.
When it says 30%, does it happen 30% of the time?
Held-back forecasts grouped by how confident they were. Points on the diagonal mean the
probabilities can be read as real chances; points below mean the model overstated them.
EXPLORATORY QUESTIONS
On Kestrel, "same as yesterday" is right on most held-back days. Why is that not evidence that the
model is unnecessary? Which number on this page answers the question instead?
On Ferngrove, run momentum only (untick every driver), then add rain. Where did the momentum go,
and what would have happened if the ops manager had added drivers the day after every sell-out?
On Brightwick, compare the flash-sale coefficient with 0 and with 1 outcome lag. Which one would
you show the owner, and how would you explain the difference in one sentence?
A Saturday delivery cuts stockouts by a lot on the day after an empty shelf and by little after a
full one. Why does its long-run effect differ from either number?
Load the supplier-switch case. What does the stability check say, and what would you do with the
first year of data?
LEARNING RESOURCES
π Going further
Many customers at once: use Panel
Dynamic Logistic Regression. With a panel, a momentum estimate mixes true habit with
some customers simply always buying (state dependence versus heterogeneity). Separating them
needs random effects and a treatment of each customer's first period.
Counts instead of yes/no: for "how many" per period, a Poisson autoregression
plays the same role.
Robust standard errors: if leftover time pattern remains, HAC (Newey-West)
standard errors are a robustness check. The Python export shows how.