commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-1142) Kalman filter gain calculation
Date Tue, 30 Sep 2014 07:59:33 GMT

    [ https://issues.apache.org/jira/browse/MATH-1142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14152917#comment-14152917
] 

Thomas Neidhart commented on MATH-1142:
---------------------------------------

I did some experiments and the proposed change is slightly faster for the test examples (cannonball)
while still returning the same results.

This performance gain should increase with a larger measurement matrix / error covariance
matrix so I am in favor of doing the change.

> Kalman filter gain calculation
> ------------------------------
>
>                 Key: MATH-1142
>                 URL: https://issues.apache.org/jira/browse/MATH-1142
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.3
>            Reporter: Arne Schwarz
>            Priority: Minor
>              Labels: performance
>             Fix For: 3.4
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> In the class KalmanFilter in the function correct(RealMatrix) the gain matrix currently
is calculated via first calculating the inverse of the residual covariance matrix s. I think
it would be more effective to calculate the gain by directly solving the linear system with
an QR or Cholesky decomposition.
> For example like this (maybe replace "Cholesky" by "QR"):
> // calculate gain matrix
> // K(k) = P(k)- * H' * (H * P(k)- * H' + R)^-1
> // K(k) = P(k)- * H' * S^-1
> // K(k) * S = P(k)- * H'
> // S' * K(k)' = H * P(k)-'
> RealMatrix kalmanGain = new CholeskyDecomposition(s).getSolver().solve(measurementMatrix.multiply(errorCovariance.transpose())).transpose();



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message