Module 26
Time Series and Stochastic Processes
How do we model, analyze, and forecast systems that evolve over time under uncertainty?
- lessons
- 31
- duration
- 56 h 5 min
- concepts
- 213
- available in English
- 31 / 31
- completed by you
0 of 31
Where it fits
Overview
Two languages for the same problem: stochastic processes (discrete- and continuous-time Markov chains, martingales, Poisson and Hawkes processes, Brownian motion, the Itô integral and lemma, stochastic differential equations, Fokker-Planck, and Girsanov) and time-series analysis (stationarity, ARMA, ARIMA, SARIMA, spectral analysis, VAR, cointegration, GARCH, state space, regime changes, change points, and probabilistic forecasting). Build each object from scratch in NumPy, simulate it with interactive trajectories, and compare it with statsmodels, arch, ruptures, or PyTorch. Finish with current research on time-series foundation models, neural SDEs, and path signatures.
Why it matters
This is the mathematical language of quantitative finance: volatility, cointegration for statistical arbitrage, Hawkes processes for order flow, and the Itô calculus behind Black-Scholes. Markov chains underpin MCMC, the MDPs in AlphaZero, and PageRank; SDEs underpin diffusion models; and properly evaluated probabilistic forecasting separates a useful model from a misleading backtest. After this module, you can read research on time-series econometrics, applied stochastic calculus, and deep-learning forecasting, and implement and debug their algorithms.
Lessons 31
- 01Stochastic processes: the common languageAn operational review of the vocabulary used throughout this module: a process as a family of random variables and as a random path, finite-dimensional laws and their consistency, filtrations as accumulated information, adapted processes and stopping times. A simple random walk provides a running example that returns as a Markov chain, a martingale and a limit producing Brownian motion.
- 02Markov chains I: transitions, state classification and first-step analysisA discrete-time Markov chain is determined by an initial distribution and a transition matrix. Derive Chapman-Kolmogorov and the strong Markov property, classify states into recurrent or transient communicating classes, and solve hitting probabilities and expected hitting times using first-step analysis and the fundamental matrix of absorbing chains.
- 03Markov chains II: stationary distribution, convergence and the ergodic theoremWhen a stationary distribution exists, when it is unique, and when the chain converges to it. Prove the convergence theorem by coupling, the ergodic theorem for time averages, and the Markov-chain central limit theorem with its asymptotic variance governing MCMC error. Study reversibility and detailed balance, then apply the results to PageRank.
- 04Mixing times, spectral gap and perfect samplingKnowing a chain converges is not enough: we must know how long it takes. Define total-variation mixing times and bound them by coupling, the spectral gap of reversible chains, and conductance through Cheeger's inequality. Study cutoff with card shuffling and conclude with Propp and Wilson's coupling from the past, which produces exact samples from π.
- 05Discrete-time martingalesA martingale formalizes a fair game and is a powerful tool for calculations at random times. Study submartingales and supermartingales, the martingale transform as a discrete precursor of the Itô integral, Doob decomposition, optional stopping and its assumptions, Wald's identity, Doob's maximal inequality, and martingale convergence, with Pólya's urn and gambler's ruin as labs.
- 06Poisson processes and point processesThe Poisson process is the canonical model of randomly arriving events: server requests, transactions and alerts. Prove the equivalence of independent-increment and exponential-wait constructions and the rare-Bernoulli limit, study superposition, thinning and order statistics, and generalize to time-varying intensities and compound sums, with exact simulation by thinning.
- 07Self-exciting point processes: conditional intensity and HawkesReal events cluster: an earthquake triggers aftershocks, a market order triggers others, and an incident can generate cascading alerts. Formalize point processes through conditional intensity, derive their likelihood and time-rescaling validation theorem, and study the Hawkes process via branching, stability, Ogata simulation, maximum-likelihood estimation and its multivariate extension.
- 08Continuous-time Markov chainsWhen state changes occur at random times, a chain is described by a rate matrix Q. Construct it from exponential holding times and a jump chain, derive the forward and backward Kolmogorov equations and their matrix-exponential solution, study equilibrium, and apply the results to birth-death processes and queues. Simulate exactly with Gillespie and uniformization.
- 09Stationarity, autocovariance and autocorrelationWith one observed path, inference requires that dependence structure remain stable over time. Distinguish strict and weak stationarity; study autocovariance and the ACF as nonnegative-definite objects; distinguish iid, martingale-difference and weak white noise; and study sample ACF with Bartlett's formula, portmanteau tests and the ergodicity that allows estimation by time averages.
- 10Time series decomposition and exponential smoothingBefore parametric models, separate trend, seasonality and remainder. Study variance-stabilizing transformations such as Box-Cox, moving-average filters, classical decomposition and STL, forecasting baselines and exponential smoothing methods including simple, Holt and Holt-Winters, with their modern innovations state-space formulation as ETS models for likelihoods and prediction intervals.
- 11AR, MA and ARMA modelsLinear time-series models: linear processes as white-noise filters, autoregressive, moving-average and ARMA models. Study causality and invertibility through polynomial roots, ACF and PACF signatures, Yule-Walker estimation and the Durbin-Levinson recursion, which gives both the PACF and the best linear predictor.
- 12Nonstationarity: unit roots and ARIMAMany economic and product series wander rather than return to a mean. Distinguish deterministic from stochastic trends, define integration order, study why standard asymptotics fail with a unit root and Dickey-Fuller limits involve Brownian integrals, and compare ADF and KPSS as complementary tools. Differencing turns an I(d) process into ARMA and defines ARIMA.
- 13Full Box-Jenkins: SARIMA, exact likelihood, diagnostics and forecastingThe complete ARIMA modeling cycle: identification, estimation, diagnostics and forecasting. Add multiplicative seasonality through SARIMA, construct exact Gaussian likelihood with the innovations algorithm, select orders using information criteria, diagnose residuals and obtain forecasts with intervals. Finish with the Hyndman-Khandakar automatic search and its limitations.
- 14Spectral analysis and long memoryView the same series in frequency: spectral density distributes variance across cycles. Study Herglotz's spectral representation, Wold decomposition, the periodogram and its inconsistency, smoothed Welch and multitaper estimators, linear filters through frequency response, and long-memory processes such as ARFIMA and the Hurst exponent, whose ACF decays as a power.
- 15General state space Markov chains and stability of autoregressive modelsAR(1), GARCH and MCMC samplers are Markov chains with continuous state spaces. Extend the theory using transition kernels, φ-irreducibility and Harris recurrence, then introduce Foster-Lyapunov drift conditions as a practical tool for proving geometric ergodicity. Apply them to nonlinear autoregressions such as threshold SETAR and connect mixing coefficients with the CLT and time-series bootstrap.
- 16Multivariate time series and VAR modelsSeveral series influence one another. Extend stationarity and cross-covariances to vectors, then study VAR(p), its companion form and stability, equation-by-equation least squares, lag selection, Granger causality, impulse responses and identification of orthogonalized shocks, and forecast-error variance decomposition.
- 17Spurious regression, cointegration and error correction modelsTwo independent random walks can appear related with high R²: this is spurious regression. When a linear combination of I(1) series is stationary, the series share a stochastic trend and are cointegrated. Study the two-stage Engle-Granger method, Granger's representation theorem, vector error-correction models and Johansen's reduced-rank test, with pairs statistical arbitrage as an application.
- 18Conditional volatility: ARCH and GARCHFinancial returns can have little predictability in the mean while volatility clusters. This lesson develops stylized facts, martingale differences, ARCH and GARCH, stationarity and moment conditions, quasi-maximum likelihood estimation, asymmetric variants and Student-t innovations, and volatility forecasting and evaluation against realized volatility.
- 19State space models for time series: Kalman in actionBuilding on the Kalman filter from m14, this lesson assembles structural time-series models, represents ARMA in state space, handles diffuse initialization and missing data, interpolates gaps with smoothing, estimates time-varying regression coefficients and forecasts with uncertainty.
- 20Regime changes: Markov-switching modelsMany series alternate between regimes with different dynamics. This lesson formulates Hamilton's hidden-Markov autoregression, derives the Hamilton filter and Kim smoother, estimates switching models by maximum likelihood and EM, and examines duration, identifiability and threshold models.
- 21Change-point detectionDetect changes in a time series distribution online or retrospectively, using Page's CUSUM, Bayesian online change-point detection, penalized segmentation, binary segmentation, dynamic programming and PELT.
- 22Probabilistic forecasting and its evaluationUseful forecasts describe distributions. This lesson develops sharpness subject to calibration, proper scoring rules, quantile forecasts, PIT diagnostics, rolling-origin evaluation, scaled metrics, Diebold-Mariano comparison and forecast combination.
- 23Brownian motionBrownian motion is central to stochastic calculus. Define it by independent Gaussian increments, construct it through random walks and the Lévy-Ciesielski series, and study invariance, path irregularity, quadratic variation, reflection, hitting times, martingales and Brownian bridges.
- 24The Itô stochastic integralConstruct integration against Brownian motion from discrete martingale transforms and adapted simple integrands, prove Itô's isometry, extend by density to L², and compare Itô and Stratonovich conventions.
- 25Itô's lemmaItô's stochastic chain rule adds a second-order quadratic-variation term. Derive one- and multidimensional formulas and the product rule, solve geometric Brownian motion, construct the stochastic exponential and state Lévy's characterization.
- 26Stochastic differential equationsStudy stochastic differential equations, existence and uniqueness, strong and weak solutions, linear equations and canonical Ornstein-Uhlenbeck, CIR and Langevin models.
- 27Path simulation: numerical methods for SDEsDerive Euler-Maruyama and Milstein, distinguish strong and weak convergence, use exact transitions when available, refine paths with bridges, diagnose instability and simulate jump diffusions.
- 28Generator, Kolmogorov, Fokker-Planck and Feynman-KacConnect SDEs and PDEs through the infinitesimal generator, Dynkin's formula, backward Kolmogorov and forward Fokker-Planck equations, stationary densities, exit times and Feynman-Kac.
- 29Change of measure: Girsanov, martingale representation and conditioned processesChange probability measures on paths with Girsanov and Novikov, calculate KL divergence between diffusion laws, apply importance sampling to rare events, and study martingale representation and Doob's h-transform.
- 30Frontier: deep learning and foundation models for time seriesMove from local time-series models to global and foundation forecasting. Study DeepAR, N-BEATS, transformers, linear baselines, zero-shot exposure, benchmarks and critical evaluation, with local experiments.
- 31Frontier: neural SDEs, latent SDEs and path signaturesLearn stochastic dynamics from data using neural and latent SDEs, variational and adversarial path models, stochastic adjoints, neural controlled differential equations and path signatures.
Module capstone
Probabilistic forecasting and scenario simulation laboratory
Build a complete system around two real public time series, one daily financial series and one hourly demand series with multiple seasonalities. Explore them and test for stationarity; implement a suite of models from scratch and validate them against libraries (ETS, SARIMA, a structural state-space model with Kalman filtering, GARCH with t innovations, and Markov switching). Detect regime changes and change points using PELT and BOCPD. Evaluate honestly using rolling origins, CRPS, pinball loss, MASE, PIT, and the Diebold-Mariano test against both a seasonal naive baseline and a zero-shot foundation model run on the local GPU. Build a scenario generator that calibrates an SDE (Ornstein-Uhlenbeck, CIR, or a jump diffusion) to the series, simulates thousands of paths with schemes of known order, and produces calibrated fan charts. Deliver a reproducible report covering modeling decisions, diagnostics, and a results table with uncertainty intervals.
Check what you already know
- Classify the states of a finite Markov chain and calculate absorption probabilities and expected absorption times by first-step analysis
- Calculate a chain's stationary distribution and justify convergence using irreducibility and aperiodicity
- Apply the optional stopping theorem to find the ruin probability and expected duration of a random walk
- Simulate a nonhomogeneous Poisson process by thinning and reason about superposition and thinning
- Write the Kolmogorov equations for a continuous-time Markov chain and simulate it with Gillespie's algorithm
- Distinguish strict and weak stationarity and interpret a sample ACF with Bartlett bands
- Identify an ARMA(p, q) model from its ACF and PACF and check causality and invertibility using polynomial roots
- Choose between differencing and detrending using ADF and KPSS tests
- Estimate a VAR, test for Granger causality, and calculate orthogonalized impulse response functions
- Fit a GARCH(1,1) by quasi-maximum likelihood and calculate its unconditional variance and persistence
- Write a state-space model of a local trend with seasonality and estimate it with the Kalman filter
- Evaluate probabilistic forecasts with CRPS, pinball loss, and PIT histograms using a rolling-origin scheme
- Calculate the quadratic variation of Brownian motion and use the reflection principle
- Apply Itô's lemma to solve geometric Brownian motion and calculate moments of Brownian functionals
- Implement Euler-Maruyama and Milstein schemes and measure their strong and weak convergence orders
- Write the Fokker-Planck equation of an SDE and obtain its stationary density
References
- Time Series: Theory and Methods
- Time Series Analysis
- Forecasting: Principles and Practice
- Markov Chains and Mixing Times
- Probability: Theory and Examples
- Stochastic Differential Equations: An Introduction with Applications
- Applied Stochastic Differential Equations
- statsmodels: Time Series analysis (tsa)