state = np.array([x, y, dx, dy], dtype=np.float32)
We will define the measurement model as a matrix that maps the state vector to the observation vector:
observation = np.array([x, y], dtype=np.float32) H = np.array([[1, 0, 0, 0], [0, 1, 0, 0]], dtype=np.float32)
We will define the process model as a matrix that updates the state vector over time:
dt = 1.0/30.0 F = np.array([[1, 0, dt, 0], [0, 1, 0, dt], [0, 0, 1, 0], [0, 0, 0, 1]], dtype=np.float32)
We will also define the measurement noise and the process noise: