All problems
Kalman Innovation Value
Problem
Compute the innovation, or measurement residual, in a Kalman filter: v = obs - h * prior, where prior is the predicted state and h is the observation matrix.
The innovation is the new information an observation carries and drives the correction applied to the state estimate.
Hint
Compare the observation with the value the model predicted for it.
Test cases
case 1
in: [10,1,8]
expected: 2
case 2
in: [5,2,3]
expected: -1
case 3
in: [0,1,0]
expected: 0
case 4
in: [7,0.5,10]
expected: 2
Starter codePython
def kalman_innovation(obs, h, prior):
# Your code here
pass4 test cases · run your code against them in the editor