# Is there a difference what measurement units use in covariance matrix

The R matrix in the Kalman filter contains measurement noise. Diagonal elements of the matrix is the power of standard deviation. Is there a difference what measurement unit to use for standard error representation? For instance is there difference between meters and kilometers or radians and milliradians? Should all elements have a similar scale?

[20180801: Stats update at the end]

Units matter, when they differ (I love the rhyme)

If they are commensurable, all values can be ranked, ordered, pairwise operated. While products of data with different units can make sense, their sum of difference is meaningless. Kilometers per second make sense, but what is "2 kilometers minus one second"? Homogeneity is thus an important thing, but... Same question happens in multivariate processing, dimension reduction, and I believe it is not fully settled yet.

In PCA or PLS for instance on multivariate units, people often normalize, by centering data and dividing by a dispersion measure. Then, people have varying options (mean/std, median/MAD, $[0,1]$ cast), more or less prone to biases, robustness. I generally use median/MAD on small datasets with outliers, but if some data are only positive, this makes little sense.

But this is not the only way. Suppose you send a rocket in the space, and have two sensors, one accurate in kilometers, and the other faulty, providing only noise around centimeters. If you do scale both, the second one will inflate, and although meaningless, would recover an unmerited strong influence on covariance matrices. This could happen as well with strongly correlated variables in different units.

Similar things are likely to influence in higher dimensions, with correlated data, etc.

So, trust the physics as long as you can.

[Update] You can check related topics in statistics, like the standard score:

Standardization of variables prior to multiple regression analysis is sometimes used as an aid to interpretation. Affif et al  (page 95) state the following.

"The standardized regression slope is the slope in the regression equation if X and Y are standardized… Standardization of X and Y is done by subtracting the respective means from each set of observations and dividing by the respective standard deviations… In multiple regression, where several X variables are used, the standardized regression coefficients quantify the relative contribution of each X variable."

However, Kutner et al.  (p 278) give the following caveat. "… one must be cautious about interpreting any regression coefficients, whether standardized or not. The reason is that when the predictor variables are correlated among themselves, … the regression coefficients are affected by the other predictor variables in the model … The magnitudes of the standardized regression coefficients are affected not only by the presence of correlations among the predictor variables but also by the spacings of the observations on each of these variables. Sometimes these spacings may be quite arbitrary. Hence, it is ordinarily not wise to interpret the magnitudes of standardized regression coefficients as reflecting the comparative importance of the predictor variables."

Most certainly yes. The units of the states are reflected in the state covariance, and state error covariance.

The units of the measurements propagate throughout the filtering and prediction steps.

Should units be appropriately scaled? Numerical accuracy typically benefits from appropriate scaling

• Thank you for your answer! I've faced with vary strange problem. I've implemented UKF and in general it works good. But in some cases with perfect (emulated) measurements a variance in state covariance matrix P increases in unusual way. For R-matrix I use meters (range 0-4e5) and degrees (range 0-360). If I change units on kilometers (0-400) and degrees (0-360) or meters (0-4e5) and milidegrees (0-3.6e5) the filters will work better. Is using appropriate scaling make sense? Or my implementation is wrong and I should search another errors. Jul 17, 2018 at 19:56
• Kalman, EKF, UKF, all need measurement noise. If you have perfect measurements, you should be using a state observer, not a KF.
– user28715
Jul 17, 2018 at 21:46