# Are there any general heuristics for Kalman filter noise parameters

Are there any generally applicable heuristics for Kalman filter noise parameters? I am working with a non-linear unscented filter and getting an initial guess for the noise covariances $$Q_k$$ and $$R_k$$ is proving difficult as wikipedia cautions. Specifically I am wondering if the condition number of the innovation covariance $$S_k$$ should be below some value? Alternatively in a well running filter, should each element in the optimal Kalman gain $$K_k$$ be in some range? Is there some other rule of thumb that would help quickly guide me towards a "sane" filter so I can use other optimization techniques to fine tune the parameters? Thank you.

• It depends on your application. Sometimes R and Q are chosen based on the model. I recommend reading ieeexplore.ieee.org/abstract/document/… May 12 '21 at 17:34
• A good initial guess for $\mathbf R_k$ is the actual anticipated measurement noise. A good initial guess for $\mathbf Q_k$ is the actual anticipated process noise, plus the "virtual" process noise inherent in the unscented transform. Are you starting there? May 12 '21 at 19:52
• @TimWescott what do you mean by "virtual" process noise? Is that diagonal or does it have cross terms? My initial guesses so far have not been good, such that the estimated state diverges, and often $S_k$ becomes singular. May 12 '21 at 20:12
• When you do the prediction step, are you using a nonlinear ODE solver to move the state forward, or are you using the linearized model from the unscented transformation? Either one of these is going to have a certain amount of error, and that error can be treated as noise. So -- are you using that? How did you arrive at $\mathbf R$ and $\mathbf Q$? May 12 '21 at 20:25
• Thanks for the tips. I suspect my issue may be my choices for state variables given what is observable. Specifically the observations are nearly totally independent of mean of two of the state variables and only really measure the difference between them, which I suspect leads to the numerical issues. Perhaps I need to adjust what parameters I am tracking in state. Does that sound plausible? Thanks May 13 '21 at 0:42

I found the following advice the most useful in practice: the relative values of $$R_k$$ and $$Q_k$$ are the most important. So if your model is less reliable than your measurements, then choose $$Q_k > R_k$$, if the model is more reliable, then $$Q_k < R_k.$$
The reason for this heuristic is the fact that the Kalman gain $$K_k$$ includes $$Q_k$$ in the nominator, whereas both $$Q_k$$ and $$R_k$$ in the denominator (cf. e.g. the Wikipedia page).