wrote a functional kalman filter. Still need to test it works with weighted regressions, add an eigenvalue check and forgetting factor