All problems
Kalman Smoothing One Step
Problem
Perform one Rauch-Tung-Striebel smoothing step: smoothed = filtered + C * (next_smoothed - next_predicted), where C = p_filtered / p_predicted.
Return the filtered value when p_predicted is 0.
Hint
The smoother gain shrinks with the uncertainty of the predicted next state.
Test cases
case 1
in: [10,1,12,11,2]
expected: 10.5
case 2
in: [0,2,4,0,4]
expected: 2
case 3
in: [5,0,7,6,3]
expected: 5
case 4
in: [3,1,3,3,0]
expected: 3
Starter codePython
def kalman_smoothing_step(filtered, p_filtered, next_smoothed, next_predicted, p_predicted):
# Your code here
pass4 test cases · run your code against them in the editor