malintha
malintha

Reputation: 176

Kalman filter matrix dimensions mismatch

I have created following dimensional matrices for a Kalman Filter:

But apparently there is a mismatch of matrix dimensions as apache Kalman filter throws matrix dimension mismatch exception.

I'm slightly confused with creating matrices suitable to a measurement matrix (Z) of 4x1 and state matrix of 4x1.

Upvotes: 1

Views: 2290

Answers (2)

YourBestBet
YourBestBet

Reputation: 1749

if H is 2x4, then R should be 2x2, and z should be 2x1

Upvotes: 1

Harpunius
Harpunius

Reputation: 120

From the documentation it's either your control vector or your measurement vector, which has an incorrect size.

There are 2 cases where that exception can be thrown.

Case predict: DimensionMismatchException - if the dimension of the control vector does not match

Case correct: DimensionMismatchException - if the dimension of the measurement vector does not fit

There are few cases, but here it is due to number of rows of matrix R being not equal to number of rows of z.

Upvotes: 0

Related Questions