Skip to content

Repository files navigation

Mini Stochastic Filtering

A collection of from-scratch, zero-dependency C implementations of university-level stochastic filtering, estimation, and control theory. Each module maps to MIT (and other top-tier university) courses, bridging theory and practice by translating textbook equations into runnable C code.

Modules

Module Topics Key Courses
mini-bayesian-filtering Recursive Bayesian estimation, prior/posterior, conjugate priors, predict-update cycle, resampling strategies MIT 6.432, Stanford EE363, CMU 16-833
mini-extended-unscented-kf EKF, UKF, sigma-point propagation, square-root UKF, iterated EKF, IMM-UKF, adaptive noise estimation, sensor fusion Stanford AA273, MIT 6.435
mini-hmm-state-estimation Hidden Markov Models, Forward algorithm, Viterbi decoding, Baum-Welch (EM), forward-backward smoothing MIT 6.867, Stanford CS229
mini-kalman-filter Discrete-time Kalman filter, predict/update, Joseph stabilized form, RTS smoother, information filter MIT 6.241J, Stanford AA203, Berkeley EE221A
mini-particle-filter Sequential Monte Carlo (SMC), SIS/SIR, auxiliary particle filter, proposal design, convergence diagnostics MIT 6.432, Stanford EE363
mini-stochastic-differential-eq Itô calculus, Brownian motion, Euler-Maruyama/Milstein schemes, Kushner-Stratonovich filtering, Zakai equation MIT 6.265/15.070, Stanford STATS 217/218
mini-stochastic-optimal-ctrl LQG control, separation principle, stochastic dynamic programming, HJB equation, certainty equivalence MIT 6.241J, Stanford AA203, Berkeley EECS C227A
mini-wiener-filter Wiener-Hopf equation, FIR Wiener filter, Levinson-Durbin recursion, adaptive filtering, MMSE estimation Stanford EE264, MIT 6.441

Design Philosophy

  • Zero external dependencies — pure C (C99/C11), only libc and libm
  • Self-contained modules — each directory has its own Makefile, include/, src/, examples/, demos/, tests/
  • Theory-to-code mapping — every module includes docs/ with course-alignment notes
  • Practical demos — state estimators, nonlinear trackers, speech recognition, stochastic controllers, and more

Building

Each module is standalone. Navigate to a module directory and run:

cd mini-bayesian-filtering
make all    # build everything
make test   # run tests

Requires GCC and GNU Make.

Project Structure

mini-stochastic-filtering/
├── mini-bayesian-filtering/          # Recursive Bayesian state estimation
├── mini-extended-unscented-kf/       # Extended & Unscented Kalman Filters
├── mini-hmm-state-estimation/        # Hidden Markov Models & inference
├── mini-kalman-filter/               # Linear Kalman filter & variants
├── mini-particle-filter/             # Sequential Monte Carlo methods
├── mini-stochastic-differential-eq/  # Itô calculus & SDE numerics
├── mini-stochastic-optimal-ctrl/     # LQG, HJB, stochastic DP
└── mini-wiener-filter/               # Optimal linear MMSE filtering

License

MIT

About

Stochastic filtering built from scratch, learn Kalman, Bayesian, particle filtering & SDEs via practical C coding

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages