[MATH-1142] Improve performance of kalman gain calculation of KalmanFilter. Thanks to Arne Schwarz.