This shows you the differences between two versions of the page.
cs401r_w2016:lab7 [2016/02/17 16:27] admin |
cs401r_w2016:lab7 [2021/06/30 23:42] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====Objective:==== | ||
- | |||
- | To understand state space models, and in particular, the Kalman filter. | ||
- | |||
- | ---- | ||
- | ====Deliverable:==== | ||
- | |||
- | For this lab, you will implement the Kalman filter algorithm on two datasets. Your notebook should produce two visualizations of the observations, the true state, the estimated state, and your estimate of the variance of your state estimates. | ||
- | |||
- | For the first dataset, you will implement a simple random accelerations model and use it to track a simple target. Your final visualization should look something like the following: | ||
- | |||
- | {{ :cs401r_w2016:lab7_kf.png?direct |}} | ||
- | |||
- | ---- | ||
- | ====Grading:==== | ||
- | Your notebook will be graded on the following elements: | ||
- | |||
- | * 10% Data is correctly mean-centered | ||
- | * 20% Correctly updates responsibilities | ||
- | * 20% Correctly updates means | ||
- | * 20% Correctly updates covariances | ||
- | * 20% Correctly updates mixing weights | ||
- | * 10% Final plot is tidy and legible | ||
- | |||
- | ---- | ||
- | ====Description:==== | ||
- | |||
- | For the first dataset, you will perform simple target tracking using the random accelerations model. The data can be found here: | ||
- | |||
- | [[http://example.com|External Link]] | ||
- | |||
- | The model is therefore given by | ||
- | |||
- | <code python> | ||
- | |||
- | # our dynamics are described by random accelerations | ||
- | A = np.asarray([ | ||
- | [ 1, 0, 1, 0, 0.5, 0 ], | ||
- | [ 0, 1, 0, 1, 0, 0.5 ], | ||
- | [ 0, 0, 1, 0, 1, 0 ], | ||
- | [ 0, 0, 0, 1, 0, 1 ], | ||
- | [ 0, 0, 0, 0, 1, 0 ], | ||
- | [ 0, 0, 0, 0, 0, 1 ] ]) | ||
- | |||
- | # our observations are only the position components | ||
- | C = np.asarray([ | ||
- | [1, 0, 0, 0, 0, 0], | ||
- | [0, 1, 0, 0, 0, 0]]) | ||
- | |||
- | # our dynamics noise tries to force random accelerations to account | ||
- | # for most of the dynamics uncertainty | ||
- | Q = 1e-2 * np.eye( 6 ) | ||
- | Q[4,4] = 0.5 # variance of accelerations is higher | ||
- | Q[5,5] = 0.5 | ||
- | |||
- | # our observation noise | ||
- | R = 20 * np.eye( 2 ) | ||
- | |||
- | # initial state | ||
- | mu_t = np.zeros(( 6, 1 )) | ||
- | sigma_t = np.eye( 6 ) | ||
- | |||
- | </code> | ||
- | |||
- | The data is given by | ||
- | |||