Skip to content

Knewton/Kalman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Kalman Filter Module Open-source code by @andersenchen and @sbchou at Knewton.

This file contains class KalmanFilter (an implementation of the hybrid Kalman
filter algorithm for the system outlined below), and a Simulator class for
testing.

KalmanFilter

The filtering algorithm produces estimates of hidden (latent) variables using a
series of continuous observations over time. (Source: http://en.wikipedia.org/wiki/Kalman_filter)

The system we solve is a set of latent scalars X = {x_1, x_2,...,x_k} given
scalar observations Z = {z_1, z_2,...,z_k} occurring at times {t_1, t_2,...,t_k}
where our latent state is evolved as a Gaussian random walk:

x_k = x_{k_1} + sqrt(t_k - t_{k-1}) * w_k with w_k ~ N(0, q) and t_k - t_{k-1}
being the time difference between our current and previous observations. 
(For explanation of the sqrt(t_k - t_{k-1}) coefficient see corresponding
blogpost on Knewton's N choose K blog.)

Given our latent state, observations are made according to:
z_k = x_k + v_k with v_k ~ N(0, r)

Simulator

This class simulates data on which to test the filter on.

test_constant generates i.i.d. normal observations and assumes a constant time
difference between observations and a constant latent state, and plots the
results of parameter recovery by the Kalman filter.

test_noisy_gaussian_walk does the same inference for a latent state evolved
according to a Gaussian random walk with uniformly distributed time differences
between observations.

About

A KalmanFilter to be discussed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages