How to estimate a kalman gain matrix from system identification method

control theoryestimationkalman filteroptimal controlsystem identification

Assume that we have the input data $u$ and output data $y$ and we want to estimate a state space model
$$\dot x = Ax + Bu\\ y = Cx$$

But we want also to find the kalman gain matrix $K$.
I found a document that explain how to estimate a state space model and at page 9 Eigensystem Realization Algorithm it shows that if we estimate a model like this

$$\dot x = \bar Ax + \bar Bu\\ y = Cx + Du$$

Where $\bar A = A + GC$ and $\bar B = [B+GD, -G]$, then we can find the matrix $A, B$ because $G$ which is the kalman gain matrix in this case, it is known from the estimation. If the dimension if the output $y$ is 1 then the $G$ will have the column size 1 as well.

I wrote an algoritm called Okid.m and it can estimate a state space model from input and output data, very easily. It's one of my favourite algorithms beacuse it fits so many different types of data.

But I want to extand it so it will generate a kalman gain matrix as well.
MataveID

Can I only change the input so $U = [u; y]$ and $Y = [y]$ and then estimate as normal? Is that so easy, or have I missed something?

Best Answer

First of all $K$ in this system is not the Kalman gain. It is a weight matrix to determine the influence of the noise on the states.

If you know the noise perfectly well, then it can be considered as an input, as you wrote in the last equation. And also if you have a way of estimating $A,B,C$ given $u,y$ of the extended system then you don't need a Kalman filter at all. Because if the estimated $A,C$ turns out to be observable, then you can uniquely calculate $x$.

Related Question