Forecasting a time series
Decomposition, change points, hierarchies and horizons — what the classical methods actually do, and where a foundation model changes the answer.
A time series is not a table of independent rows and almost every mistake in forecasting comes from treating it as one. The order matters, the gaps matter, the fact that yesterday is in the training set and tomorrow is not matters. The classical methods in this cluster — decomposition, cumulative sums, autocorrelation, reconciliation — are old because they encode those constraints exactly, and they are worth understanding numerically rather than as names, because the arithmetic is short enough to follow and it is what a library is doing on your behalf.
The recent arrival is the pretrained forecasting model, which promises a forecast for a series it has never seen. That is a real capability with a specific shape: it transfers pattern, not units, and it is bounded by a context window and by what was in a training corpus. These pages describe the mechanism in both traditions and are explicit about which questions each one cannot answer.
Time Series Foundation Models: What Chronos and TimeGPT Actually Do
How a model pretrained on other people's series produces a forecast for yours, described through the two designs that are actually in use.
9 min read
Zero-Shot Time Series Forecasting Without Training a Model
What the word zero-shot claims when the input is numbers rather than text, and the specific kind of seasonal pattern it fails on.
8 min read
Why Language Models Struggle to Forecast Numbers
The obstacle is representational: a tokenizer that splits digits arbitrarily and a loss that does not know one number is near another.
9 min read
STL Decomposition: Trend, Seasonal and Residual, By Hand
The six steps of STL's inner loop in the order they run, worked numerically on a twelve-point series.
10 min read
Change Point Detection in a Time Series, Explained
How a cumulative sum accumulates evidence for a shift, worked to a signal on a labelled series, and where the change point is read from.
9 min read
Multivariate Time Series Forecasting: What Changes When Series Interact
The cross-series coefficient and the cross-series covariance a univariate model drops, worked on a two-series example.
9 min read
Hierarchical Forecast Reconciliation Explained
Why independently produced forecasts do not add up, and what bottom-up, top-down and least-squares reconciliation each do about it.
10 min read
Forecasting With Exogenous Variables: What a Model Needs Beyond History
Leading, coincident and lagging inputs, and the single question that decides whether a regressor helps: is it known at forecast time?
9 min read
Cold-Start Forecasting for a Product With No History
Three fallbacks ordered by how much history each needs, with the shrinkage arithmetic that moves you between them.
9 min read
Time Series Anomaly Detection With Isolation Forest
Isolation Forest has no notion of time, so the work is in the features; this builds them and scores a synthetic series end to end.
10 min read
Time Series Anomaly Detection With Autoencoders
How reconstruction error becomes an anomaly score, and how to set the threshold from the error distribution rather than from a rule of thumb.
10 min read
Detecting Seasonality Automatically in a New Series
The autocorrelation arithmetic that locates a period, worked on a short series, including the case where it cannot decide.
9 min read
Rolling Window Forecasting: Window Size as a Bias-Variance Trade
Why a longer rolling window lowers noise and raises bias, with the mean squared error of three window widths worked out on one stated series.
9 min read
Long-Horizon Forecasting: Why Error Compounds Past a Few Steps
How forecast variance grows with the horizon, worked out from a stated one-step error, and why it is bounded for a stationary series and unbounded for a random walk.
9 min read
When a Classical Model Beats a Transformer at Forecasting
An argument that the choice between exponential smoothing and a deep forecaster is decided by how many series you have and how long they are, with the threshold worked out as a ratio.
10 min read
N-BEATS Explained: Basis Expansion and Doubly Residual Stacking
How N-BEATS forecasts by having each block emit basis-expansion coefficients and subtract its own reconstruction from the input, and what the interpretable configuration constrains.
9 min read
Temporal Fusion Transformer Explained
The three selection mechanisms the TFT stacks — variable selection, gated residual networks and interpretable multi-head attention — and what each one earns its place by doing.
10 min read
Time Series Embeddings for Similarity Search
Why dynamic time warping cannot be put in a vector index and fixed-length embeddings can, worked through on a pair of short series where the two distances disagree.
9 min read
What Forecasting 10,000 SKUs a Night Actually Costs
The compute cost of a nightly forecast run derived from labelled assumptions about per-series fit time, core count and instance rate, and why the total is not what makes it expensive.
10 min read
Intermittent Demand: Why Standard Forecasting Models Fail on Sparse Series
Why a mostly-zero series makes the forecast-zero-forever policy win on mean absolute error, worked out on a 20-period example, and what Croston's method does instead.
9 min read
Forecasting at Different Time Granularities: Hourly, Daily, Weekly
The aggregation arithmetic showing how much noise cancels moving from hourly to daily, why correlated errors destroy most of that benefit, and what coarsening costs you.
9 min read
Quantile Regression for Forecasting a Range, Not a Point
Why minimising the pinball loss returns the requested quantile, derived on a ten-value dataset, and the two traps that make separately-fitted quantiles wrong.
9 min read
Forecasting Demand for a New Store Location
The analog-store method worked end to end on one new site, with the distance weighting computed two ways to show how a near-duplicate analog can swallow the estimate.
10 min read
Detecting Structural Breaks in a Time Series
How a Chow test distinguishes a change in the underlying relationship from a single strange observation, with the F-statistic computed from labelled residual sums.
9 min read
Other topics
- LLM fundamentals & architecture
- Tokens, tokenization & context windows
- Prompt engineering
- Reasoning models & test-time compute
- Multimodal AI: vision, audio, video
- RAG & retrieval
- Embeddings & vector search
- AI agents & tool use
- Structured output & function calling
- Fine-tuning & post-training
- Local inference errors, string by string
- Running local models day to day
- Testing code that calls an LLM
- Snapshot and property testing for model output
- Regression suites for prompts
- Eval gates in CI
- Flaky tests against a model
- Determinism and the cost of testing
- Contract and streaming tests
- Testing tool calls and retrieval
- Inference, serving & latency
- Rolling out a prompt change
- Testing AI systems in practice
- Machine learning on tabular data
- Geospatial data and models
- Understanding audio that is not speech
- Understanding video
- Core computer vision tasks
- Machine learning on graphs
- Point clouds and 3D
- Evaluation, benchmarks & LLM-as-judge
- Sensor and IoT data
- Logs and event streams
- Models over biological sequences
- Machine learning on molecules
- Embedding and searching code
- Extracting invoices and purchase orders
- Receipts, statements and tax forms
- Insurance policies and contracts
- Deeds, court filings and patents
- Extracting from medical records
- Observability & LLMOps
- CVs, certificates and identity documents
- Shipping, customs and technical documents
- Meetings, email, chat and filled-in forms
- Building an extraction pipeline
- Business, property and inspection documents
- Contract clauses and insurance claims
- Regulated and compliance documents
- Consumer, travel and closing documents
- Mapping one chat API onto another
- SDK and framework migrations
- Hallucination & failure modes
- Re-embedding and model deprecation
- Cutting over between providers
- Parity gaps, shims and legacy endpoints
- Moving between model versions
- Migrating vector stores and caches
- Mapping capabilities and parameters
- Migrating pipelines and agents
- Contracts, runbooks and rollback
- Auditing a codebase before a cutover
- Compliance and fine-tune migration
- LLM cost engineering
- Routing, cost tracking and multi-tenancy
- What a migration does to your prompts
- AI security & prompt injection
- Privacy, compliance & data residency
- AI governance, policy & society
- Building reliable AI applications
- AI hardware, GPUs & compute
- Open-weight models & local inference
- AI for developers & coding agents
- AI in industry: vertical playbooks
- AGI, superintelligence, alignment & the long future
- Machine learning foundations
- NLP fundamentals & classical tasks
- Data engineering for AI
- Synthetic data & dataset curation
- AI product design & UX
- Search, ranking & recommendation
- Enterprise adoption & change management
- AI careers, skills & teams
- Reading AI research
- AI in science & discovery
- Robotics & embodied AI
- AI economics, markets & business models
- AI myths, hype & media literacy
- Context engineering
- Shipping AI features: patterns & anti-patterns
- Build it: end-to-end AI tutorials
- Python for AI: hands-on recipes
- TypeScript, React and the web
- Frameworks and SDKs
- Errors and troubleshooting
- AI facts, numbers and statistics
- The history of AI
- The maths behind AI
- Architectures beyond the transformer
- Reinforcement learning
- Diffusion and generative media
- Speech, audio and voice engineering
- Benchmarks, one at a time
- AI search visibility
- Infrastructure and operations
- Databases and storage for AI
- Knowledge graphs and structured knowledge
- Classical ML in production
- Regulation, jurisdiction by jurisdiction
- Prompt recipes and pattern library
- AI for people who do not write code
- Writing, media and creative work
- Edge and on-device AI
- Interpretability and model internals
- Field notes
- OpenAI model behaviour
- Claude model behaviour
- Gemini model behaviour
- Llama model behaviour
- Mistral model behaviour
- Qwen model behaviour
- DeepSeek model behaviour
- Cohere model behaviour
- Grok model behaviour
- Small model behaviour
- Hybrid model architectures
- Token cost by language and script
- Transliteration, romanization and script handling
- Locale-correct output
- Multilingual generation quality
- Multilingual pipelines
- The EU AI Act, article by article
- AI under the GDPR and EU data law
- US AI regulation, state and sector
- International AI governance and standards
- AI litigation and enforcement
- Running AI workloads on AWS
- Running AI workloads on Google Cloud
- Running AI workloads on Azure
- AI at the edge: Workers, Vercel and Netlify
- Serving models on Kubernetes
- Operating AI infrastructure
- Quantization formats and what they cost
- llama.cpp, flag by flag
- Ollama and the desktop local-model runtimes
- Local models on Apple Silicon
- Hardware for local inference
- Running speech and embedding models locally
- Model files, adapters and conversion
- VRAM arithmetic for local models