When calling `filter` and then `smooth`, the number of kalman gains is duplicated due to the variable being a list that is extended on each loop. Solution: pre-allocate an array in the `filter` method.