SlowGuess/NeurIPS_2023_OCR huggingface dataset:
where  $C = \Omega(\mathbb{E}[||u||^2])$  is the asymptotic lower bound ("big omega") of the expected square velocity  $u$ . In particular,  $C > 0$  and is unbounded as the typical velocity grows.
Proof sketch (see complete proof in Appendix A.1). We have  $\text{Cov}(Z - \tilde{H}X) = \text{Cov}(Z - HX + (H - \tilde{H})X) = R + \text{Cov}((H - \tilde{H})X)$ , where the last equality relies on the independence between the target velocity and the estimation error  $\tilde{X} - X$ . We then calculate  $\text{Cov}((H - \tilde{H})X)$ .
Proposition 1 has an intuitive interpretation: when measuring the velocity, Algorithm 1 only considers the inherent Doppler signal noise  $\sigma_{D}$ . However, the effective noise  $\sigma_{D} + C$  also includes the transformation error from Doppler to the Cartesian coordinates, caused by the uncertainty in  $H(X)$  itself. Notice that heuristic solutions such as inflation of  $R$  would not recover the effective noise  $\tilde{R}$ , which only differs from  $R$  in one specific entry.
Yet, as demonstrated below, OKF captures the effective noise  $\tilde{R}$  successfully. Critically, it does so from mere data: OKF does not require the user to specify the model correctly, or to even be aware of the violation of Assumption 1.
Experiments: We test KF and OKF on the toy Problem 1 using the same methodology as in Section 4. In accordance with Proposition 1, OKF adapts the Doppler noise parameter: as shown in
(a)  $\mathrm{KF} / \hat{R}$
(b) OKF/R
Figure 6: The parameters  $\hat{R}$  learned by KF and OKF in the toy Doppler problem. The rows and columns' entries correspond to location  $(x,y,z)$  and radial velocity (Doppler). The simulated noise variance is  $100^2$  for the positional dimensions and  $5^2$  for velocity, and is estimated accurately by the KF. However, OKF increases the noise associated with velocity, in accordance with Proposition 1. The decrease in the positional variance comes from scale-invariance in the toy problem, as discussed in Appendix A.1.
Extended experiments: This section and Section 4 test OKF against KF in three specific variants of the Doppler problem. One may wonder if OKF's advantage generalizes to other scenarios, such as:
- Different subsets of violations of Assumption 1;
- Other baseline models than KF, e.g., Optimized Extended-KF;
- Small training datasets;
- Generalization to out-of-distribution test data.
The extended experiments in Appendix B address all of the concerns above by examining a wide range of problem variations in the Doppler radar domain. In addition, other domains are experimented below. In all of these experiments, OKF outperforms Algorithm 1 in terms of MSE.
Finally, the goal-misalignment of Algorithm 1 is demonstrated directly by two results: even oracle noise estimation fails to optimize the MSE (Appendix B.1); and feeding more data to Algorithm 1 may degrade the MSE (Appendix B.2). Fig. 7 presents a sample of the results of Appendix B.2.
Fig. 6, it increases  $\sigma_{D}$  in proportion to the location noise by a factor of  $\approx 13$ . Note that we refer to the proportion instead of absolute values due to scale-invariance in the toy problem, as discussed in Appendix A.1. Following the optimization, OKF reduces the test MSE by  $44\%$  - from 152 to 84.
Figure 7: Different train data sizes in the Doppler problem (Fig. 3). Due to objective misalignment, Algorithm 1 deteriorates with more train data.
Figure 8: A sample of 2 trajectories in the first frame of MOT20 test video, along with the predictions of KF and OKF.
(a) Video tracking
(b) Lidar-based state estimation
Figure 9: Summary of the test errors in the video and lidar problems. The dashed lines correspond to MSE. Both  $z$ -values correspond to  $p$ -value  $< 10^{-6}$ . Each  $z$ -value is calculated over  $N$  test trajectories as follows:  $z = \frac{\mathrm{mean}(\{\Delta_i\})}{\mathrm{std}(\{\Delta_i\})}\sqrt{N}$ , where  $\Delta_{i} = err_{i}(KF)^{2} - err_{i}(OKF)^{2}$  is the square-error difference on trajectory  $1 \leq i \leq N$ .
5.2 Video Tracking
The MOT20 dataset [Dendorfer et al., 2020] contains videos of real-world targets (mostly pedestrians, as shown in Fig. 8), along with their true location and size in every frame. For our experimental setup, since object detection is out of the scope, we assume that the true locations are known in real-time. The objective is to predict the target location in the next frame. The state space corresponds to the 2D location, size and velocity, and the observations include only the location and size. The underlying dynamics  $F$  of the pedestrians are naturally unknown, and the standard constant-velocity model is used for  $\tilde{F}$ . This results in the following model:
$$
\tilde {F} = \left( \begin{array}{c c c c} 1 & & 1 \\ & 1 & & 1 \\ & & 1 & \\ & & & 1 \end{array} \right), \quad \tilde {H} = H = \left( \begin{array}{c c c c} 1 & & 0 & 0 \\ & 1 & & 0 \\ & & 1 & 0 \\ & & & 1 \end{array} \right).
$$
Notice that the known observation model  $\tilde{H} = H$  is linear ( $H$  is independent of  $X$ ), hence poses a substantial difference from Section 5.1 in terms of violations of Assumption 1.
The first three videos with 1117 trajectories are used for training, and the last video with 1208 trajectories for testing. As shown in Fig. 8a, OKF reduces the test MSE by  $18\%$  with high statistical significance.
5.3 Lidar-based State Estimation in Self Driving
Consider the problem of state-estimation in self-driving, based on lidar measurements with respect to known landmarks [Moreira et al., 2020]. The objective is to estimate the current vehicle location. We assume a single landmark (since the landmark matching problem is out of scope). We simulate driving trajectories consisting of multiple segments, with different accelerations and turn radiuses
(see Fig. 15a in the appendix). The state is the vehicle's 2D location and velocity, and  $\tilde{F}$  is modeled according to constant-velocity. The observation (both true  $H$  and modeled  $\tilde{H}$ ) corresponds to the location, with an additive Gaussian i.i.d noise in polar coordinates. This results in the following model:
$$
\tilde {F} = \left( \begin{array}{c c c c} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array} \right), \quad \tilde {H} = H = \left( \begin{array}{c c c c} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \end{array} \right).
$$
We train KF and OKF over 1400 trajectories and test them on 600 trajectories. As shown in Fig. 8b, OKF reduces the test MSE by  $10\%$  with high statistical significance.
Notice that the lidar problem differs from Section 5.1 in the linear observation model  $H$ , and from Section 5.2 in the additive noise. Both properties have a major impact on the problem, as analyzed in Proposition 1 and below, respectively.
Theoretical analysis: As mentioned in Section 5.1 and discussed in Appendix A.2, the i.i.d noise in polar coordinates is not i.i.d in Cartesian ones. To isolate the i.i.d violation and study its effect, we define a simplified toy model – with simplified states, no-motion model  $F$ , isotropic motion noise  $Q$  and only radial observation noise. Note that in contrast to Section 5.1, the observation model is already linear.
Problem 2 (The toy lidar problem). The toy lidar problem is the filtering problem modeled by Eq. (1) with the following parameters:
$$
F = H = \left( \begin{array}{c c} 1 & 0 \\ 0 & 1 \end{array} \right), Q = \left( \begin{array}{c c} q & 0 \\ 0 & q \end{array} \right), R _ {p o l a r} = \left( \begin{array}{c c} r _ {0} & 0 \\ 0 & 0 \end{array} \right),
$$
for some unknown  $q, r_0 > 0$ , with observation noise drawn i.i.d from  $\mathcal{N}(0, R_{polar})$  in polar coordinates. The initial state  $X_0$  follows a radial distribution (i.e., with a PDF of the form  $f(||x_0||)$ ).
Proposition 2. As the number  $N$  of train trajectories in Problem 2 grows, the noise parameter  $\hat{R}_N(KF)$  estimated by Algorithm 1 converges almost surely:
$$
\hat {R} _ {N} (K F) \xrightarrow {\text {a . s .}} \hat {R} _ {e s t} = \left( \begin{array}{c c} r _ {0} / 2 & 0 \\ 0 & r _ {0} / 2 \end{array} \right).
$$
On the other hand, under regularity assumptions, the MSE is minimized by the parameter  $\hat{R}_{opt} = \left( \begin{array}{cc}r & 0\\ 0 & r \end{array} \right)$ , where  $r < r_0 / 2$ .
Proof sketch (see complete proof in Appendix A.2). For  $\hat{R}_{est}$ , we calculate  $\mathbb{E}[\hat{R}_N(KF)]$  and use the law of large numbers. For the calculation, we transform  $R_{polar}$  to Cartesian coordinates using the random direction variable  $\theta$ , and take the expectation over  $\theta \sim U([0, 2\pi))$ . The uniform distribution of  $\theta$  comes from the radial symmetry of the problem. For  $\hat{R}_{opt}$ , we calculate and minimize the expected square error directly.
Intuitively, Proposition 2 shows that the i.i.d violation reduces the effective noise. Note that the analysis only holds for the unrealistic toy Problem 2. The empirical setting in this section is less simplistic, and generalizing Proposition 2 is not trivial. Fortunately, OKF optimizes directly from the data, and does not require such theoretical analysis. Fig. 10 shows that indeed, in accordance with the intuition of Proposition 2, OKF learns to reduce the values of  $\hat{R}$  in comparison to KF. This results in reduced test errors as specified above.
Figure 10: The parameters  $\hat{R}$  learned in the lidar problem. From data alone, OKF learns to decrease the noise parameters, consistently with Proposition 2.
Noise estimation of the KF parameters from observations alone has been studied for decades, as supervised data (Definition 1) is often unavailable. Various methods were studied, based on autocorrelation [Mehra, 1970, Carew and Belanger, 1973], EM [Shumway and Stoffer, 2005] and others [Odelson et al., 2006, Feng et al., 2014, Park et al., 2019]. When supervised data is available, noise estimation reduces to Eq. (2) and is considered a solved problem [Odelson et al., 2006]. We show that while noise estimation is indeed easy from supervised data, it may be the wrong objective to pursue.
**Optimization:** We apply gradient-based optimization to the KF with respect to its errors. In absence of supervised data, gradient-based optimization was suggested for other losses, such as smoothness [Barratt and Boyd, 2020]. In the supervised setting, noise estimation is typically preferred [Odelson et al., 2006], although optimization without gradients was suggested in Abbeel et al. [2005]. In practice, "optimization" of KF is sometimes handled by trial and error [Jamil et al., 2020] or grid search [Formentin and Bittanti, 2014, Coskun et al., 2017]. In other cases,  $Q$  and  $R$  are restricted to be diagonal [Li et al., 2019, Formentin and Bittanti, 2014]. However, such heuristics may not suffice when the optimal parameters take a non-trivial form.
Neural Networks (NNs) in filtering: The NKF in Section 4 relies on a recurrent NN. NNs are widely used in non-linear filtering, e.g., for online prediction [Gao et al., 2019, Iter et al., 2016, Coskun et al., 2017, fa Dai et al., 2020, Belogolovsky et al., 2022], near-online prediction [Kim et al., 2018], and offline prediction [Liu et al., 2019b]. Learning visual features for tracking via a NN was suggested by Wojke et al. [2017]. NNs were also considered for related problems such as data association [Liu et al., 2019a], model switching [Deng et al., 2020], and sensors fusion [Sengupta et al., 2019].
In addition, all the 10 studies cited in Section 1 used a NN model for non-linear filtering, with either KF or EKF as a baseline for comparison. As discussed above, none has optimized the baseline model to a similar extent as the NN. As demonstrated in Section 4, such methodology could lead to unjustified conclusions.
7 Summary
We observed that violation of the KF assumptions is common, and is potentially difficult to notice or model. Under such violation, we analyzed (theoretically and empirically) that the standard noise estimation of the KF parameters conflicts with MSE optimization. An immediate consequence is that the KF is often used sub-optimally. A second consequence is that in many works in the literature, where a neural network is compared to the KF, the experiments become inconclusive: they cannot decide whether the network succeeded due to superior architecture, or merely because its parameters were optimized. We presented the Optimized KF (OKF), and demonstrated that it can solve both issues (Section 5 and Section 4, respectively).
From a practical point of view, the OKF is available on PyPI and is easily applicable to new problems. Since its architecture is identical to the KF, and only the parameters are changed, the learned model causes neither inference-time delays nor deployment overhead. All these properties make the OKF a powerful practical tool for both linear and non-linear filtering problems.
The authors thank Tal Malinovich, Ophir Nabati, Zahar Chikishev, Mark Kozdoba, Eli Meirom, Elad Sharony, Itai Shufaro and Shirli Di-Castro for their helpful advice. This work was partially funded by the European Union's Horizon Europe Programme, under grant number 101070568.
Robert H. Shumway and David S. Stoffer. Time Series Analysis and Its Applications (Springer Texts in Statistics). Springer-Verlag, Berlin, Heidelberg, 2005. ISBN 0387989501.
Harold Wayne Sorenson. Kalman Filtering: Theory and Application. IEEE Press, 1985.
D. J. Thomson. Jackknifing multiple-window spectra. In Proceedings of ICASSP '94. IEEE International Conference on Acoustics, Speech and Signal Processing, volume vi, pages VI/73–VI/76 vol.6, 1994.
Israr Ullah, Muhammad Fayaz, and DoHyeun Kim. Improving accuracy of the kalman filter algorithm in dynamic conditions using ann-based learning module. Symmetry, 11(1), 2019. ISSN 2073-8994.
E. A. Wan and R. Van Der Merwe. The unscented kalman filter for nonlinear estimation. Proceedings of the IEEE 2000 Adaptive Systems for Signal Processing, pages 153-158, 2000.
Nicolai Wojke, Alex Bewley, and Dietrich Paulus. Simple online and realtime tracking with a deep association metric. In 2017 IEEE International Conference on Image Processing (ICIP), pages 3645-3649, 2017.
L. Zanni, J. Le Boudec, R. Cherkoui, and M. Paolone. A prediction-error covariance estimator for adaptive kalman filtering in step-varying processes: Application to power-system state estimation. IEEE Transactions on Control Systems Technology, 25(5):1683-1697, 2017.
Paul Zarchan and Howard Musoff. Fundamentals of Kalman Filtering: A Practical Approach. American Institute of Aeronautics and Astronautics, 2000.
Tianyu Zheng, Yu Yao, Fenghua He, and Xinran Zhang. An rnn-based learnable extended kalman filter design and application. In 2019 18th European Control Conference (ECC), pages 3304-3309, 2019.
Hui Zhong, Zaiyi Chen, Chuan Qin, Zai Huang, Vincent W. Zheng, Tong Xu, and Enhong Chen. Adam revisited: a weighted past gradients perspective. Frontiers of Computer Science, 2020.
1 Introduction 1
2 Preliminaries 2
3 Optimized Kalman Filter 3
4 OKF vs. Neural KF: Is the Non-Linearity Helpful? 5
5 OKF vs. KF: 6
6 Related Work 10
7 Summary 10
A Theoretical Analysis 15
B OKF: Extended Experiments 17
C Neural KF: Extended Discussion and Experiments 22
A.1 Non-linear Observation
In this section, we discuss the relation between the theoretical analysis of Proposition 1 and the empirical results shown in Fig. 6. Then, we provide the proof of Proposition 1.
Fig. 6 vs. Proposition 1: Fig. 6 displays the noise parameters  $\hat{R}$  learned by OKF in the toy problem. In accordance with Proposition 1, the noise  $\sigma_{D}$  associated with Doppler is increased compared to the true measurement noise  $R$ . In fact, not only  $\sigma_{D}$  is increased, but also the positional variances are decreased, which is not explained by Proposition 1. This phenomenon origins in the absence of dynamics noise in this toy problem ( $Q \equiv 0$ ), which leads to scale-invariance w.r.t. the absolute values of  $\hat{R}$ . That is, if we multiply the whole matrix  $\hat{R}$  by a constant factor, the filtering errors are unaffected. Specifically, if we multiply  $\hat{R}$  of Fig. 6b by a factor of  $\approx 3$ , the positional variances become aligned with those of Fig. 6a, and  $\sigma_{D}$  is increased by a factor of  $\approx 13$  – in accordance with Proposition 1. We repeated the tests with this modified  $\hat{R}$ , and indeed, the results were indistinguishable from the original OKF.
Proof of Proposition 1. Recall that in this problem, the KF applies the update step using an estimated observation model  $\tilde{H} = H(\tilde{X})$ :
$$
\tilde {H} = \left( \begin{array}{c c c c c c} 1 & & & & & \\ & 1 & & & & \\ & & 1 & & & \\ & & & \tilde {x} _ {x} / \tilde {r} & \tilde {x} _ {y} / \tilde {r} & \tilde {x} _ {z} / \tilde {r} \end{array} \right).
$$
Denoting the normalized estimation error  $dx' = \frac{\tilde{x}}{\tilde{r}} - \frac{x}{r}$ , we can rewrite  $\tilde{H}$  as
$$
\tilde {H} = H + \left( \begin{array}{c c c c} 0 & & \\ & 0 & & \\ & & d x _ {x} ^ {\prime} & d x _ {y} ^ {\prime} d x _ {z} ^ {\prime} \end{array} \right).
$$
By shifting the observation model in Eq. (1) from  $H$  to  $\tilde{H}$ , and denoting the noise by  $\nu = (\nu_{x},\nu_{y},\nu_{z},\nu_{D})^{\top}$ , we receive
$$
Z = H X + \nu = \tilde {H} X + \left( \begin{array}{c} \nu_ {x} \\ \nu_ {y} \\ \nu_ {z} \\ \nu_ {D} - d x _ {x} ^ {\prime} u _ {x} - d x _ {y} ^ {\prime} u _ {y} - d x _ {z} ^ {\prime} u _ {z} \end{array} \right) = \tilde {H} X + \left( \begin{array}{c} \nu_ {x} \\ \nu_ {y} \\ \nu_ {z} \\ \nu_ {D} - d x ^ {\prime} \cdot u \end{array} \right),
$$
where  $u$  denotes the current target velocity. We see that the effective observation noise is  $\tilde{\nu} = Z - \tilde{H} X = (\nu_x, \nu_y, \nu_z, \nu_D - dx' \cdot u)^\top$ .
To show that all the off-diagonal entries of  $\tilde{R} = Cov(\tilde{\nu})$  vanish, recall that the estimation error  $dx^{\prime}$  is assumed to be independent of the velocity  $u$ . According to Eq. (1),  $\nu$  is also independent of  $u$ . Hence,  $Cov(dx_{x}^{\prime}\cdot u_{x},\nu_{x}) = E(dx_{x}^{\prime}\cdot u_{x}\cdot \nu_{x}) = E(dx_{x}^{\prime}\nu_{x})E(u_{x})$  which vanishes by symmetry  $(E(u_{x}) = 0)$ . The same result holds for coordinates  $y,z$ . Thus,  $\tilde{R}$  is diagonal. Finally, by denoting  $C = Var(dx^{\prime}\cdot u) > 0$  we have  $Cov(\tilde{\nu}) = \tilde{R}$  as required.
Relying again on symmetry  $E(u), E(dx') = 0$ , we can further calculate  $C = \text{Var}(dx' \cdot u) = E(||dx'||^2)E(||u||^2) = \Omega(E(||u||^2))$ , where  $\Omega$  ("big-omega") corresponds to an asymptotic lower bound.
A.2 Non-i.i.d Noise
The assumption of i.i.d noise in Assumption 1 is violated in many practical scenarios. Certain models with non-i.i.d noise can be solved analytically, if modeled correctly. For example, if the noise is auto-regressive with a known order  $p$ , an adjusted KF model may consider the last  $p$  values of the noise itself as part of the system state [Geist and Pietquin, 2011]. However, the actual noise model is often unknown or infeasible to solve analytically.
Furthermore, the violation of the i.i.d assumption may even go unnoticed. We discuss a potential example in Section 5, where the noise is i.i.d in spherical coordinates - but is not so after the transformation to Cartesian coordinates. To see that, consider a radar with noiseless angular estimation (i.e.,
only radial noise), and a low target  $(x_{z}\approx 0)$ . Clearly, most of the noise concentrates on the XY plane - both in the current time-step and in the following ones (until the target moves away from the plane). Hence, the noise is statistically-dependent over time-steps.
We may formalize this intuition for the toy Problem 2. Denote the system state at time  $t$  by  $X_{t} = ((X_{t})_{1}, (X_{t})_{2})^{\top}$ , and denote  $\tan \theta_{t} = \frac{(X_{t})_{2}}{(X_{t})_{1}}$ . By transforming  $R_{polar}$  of Problem 2 to Cartesian coordinates, the observation noise is drawn from the distribution  $\nu_{t} \sim \mathcal{N}(0, R(\theta_{t}))$ , where
$$
R (\theta) = \left( \begin{array}{c c} r _ {0} \cos^ {2} (\theta) & r _ {0} \cos (\theta) \sin (\theta) \\ r _ {0} \cos (\theta) \sin (\theta) & r _ {0} \sin^ {2} (\theta) \end{array} \right). \tag {8}
$$
Since consecutive time steps are likely to have similar values of  $\theta_{t}$ , the noise  $\nu_{t}$  is no longer independent across time steps.
The effect of this violation of the i.i.d assumption is analyzed in Proposition 2, whose proof is provided below.
Proof of Proposition 2.
Noise estimation: First, notice that the whole setting of Problem 2 is invariant to the target direction  $\theta$ : the initial state distribution is radial, and the motion noise  $Q$  is isotropic. Hence, for any target at any time-step,  $\theta_t \sim [0, 2\pi)$  is uniformly distributed. By direct calculation,
$$
E _ {\theta} \left[ \hat {R} _ {N} (K F) _ {1 1} \right] = E _ {\theta} \left[ r _ {0} \cos^ {2} \theta \right] = \int_ {0} ^ {2 \pi} \frac {r _ {0}}{2 \pi} \cos^ {2} \theta d \theta = \frac {r _ {0}}{2}
$$
$$
E _ {\theta} \left[ \hat {R} _ {N} (K F) _ {2 2} \right] = E _ {\theta} \left[ r _ {0} \sin^ {2} \theta \right] = \int_ {0} ^ {2 \pi} \frac {r _ {0}}{2 \pi} \sin^ {2} \theta d \theta = \frac {r _ {0}}{2}
$$
$$
E _ {\theta} \left[ \hat {R} _ {N} (K F) _ {1 2} \right] = E _ {\theta} \left[ \hat {R} _ {N} (K F) _ {2 1} \right] = E _ {\theta} \left[ r _ {0} \cos \theta \sin \theta \right] = 0.
$$
Since the targets in the data are i.i.d, the noise estimation of Algorithm 1 converges almost surely according to the law of large numbers, as required:
**Optimization:** We use again the radial symmetry and invariance to rotations in the problem: w.l.o.g, we assume that the optimal noise covariance parameter is diagonal, i.e.,  $\hat{R}_{opt}(r) = \begin{pmatrix} r & 0 \\ 0 & r \end{pmatrix}$  for some  $r > 0$ . Our goal is to find  $r$ , and in particular to compare it to  $r_0 / 2$ .
At a certain time  $t$ , where the system state is  $X_{t}$ , denote  $E[X_{t}] = x_{0} = (x_{1},x_{2})^{\top}$  and  $Cov(X_{t}) = P_{0} = \left( \begin{array}{cc}p & 0\\ 0 & p \end{array} \right)$  (where  $p > 0$ ). Denote the observation received at time  $t$  by  $z = (x_{1} + dx_{1},x_{2} + dx_{2})^{\top}$ . We are interested in the point-estimate  $\hat{x}$  of the KF following the update step (Fig. 2). By substituting  $x_0, P_0$ , the observation  $z$  and the noise parameter  $\hat{R}_{opt}(r)$  in the update step, we have
$$
\begin{array}{l} \hat {x} = x _ {0} + P _ {0} H ^ {\top} (H P _ {0} H ^ {\top} + \hat {R} _ {o p t} (r)) ^ {- 1} (z - H x _ {0}) = x _ {0} + P _ {0} (P _ {0} + \hat {R} _ {o p t} (r)) ^ {- 1} (z - x _ {0}) \\ = x _ {0} + \left( \begin{array}{c c} \frac {p}{p + r} & 0 \\ 0 & \frac {p}{p + r} \end{array} \right) \left( \begin{array}{c} d x _ {1} \\ d x _ {2} \end{array} \right) = \left( \begin{array}{c} x _ {1} + \frac {p}{p + r} d x _ {1} \\ x _ {2} + \frac {p}{p + r} d x _ {2} \end{array} \right). \\ \end{array}
$$
On the other hand, the true observation noise covariance at time  $t$  is  $R(\theta_t)$  of Eq. (8) (for the random variable  $\theta_t$ ). If we add the assumption that the state  $X_t$  is normally distributed  $(X_t \sim \mathcal{N}(x_0, P_0))$ , and use the true noise covariance  $R(\theta_t)$ , then the update step of Fig. 2 gives us the true posterior expected state:
$$
\begin{array}{l} x _ {t r u e} = x _ {0} + P _ {0} \left(P _ {0} + R \left(\theta_ {t}\right)\right) ^ {- 1} (z - x _ {0}) \\ = x _ {0} + \left( \begin{array}{c c} \frac {r _ {0} \sin^ {2} \theta + p}{p + r _ {0}} & - \frac {r _ {0} \cos \theta \sin \theta}{p + r _ {0}} \\ - \frac {r _ {0} \cos \theta \sin \theta}{p + r _ {0}} & \frac {r _ {0} \cos^ {2} \theta + p}{p + r _ {0}} \end{array} \right) \left( \begin{array}{c} d x _ {1} \\ d x _ {2} \end{array} \right) \\ = \left( \begin{array}{c} x _ {1} + \frac {(r _ {0} \sin^ {2} \theta + p) d x _ {1} - (r _ {0} \cos \theta \sin \theta) d x _ {2}}{p + r _ {0}} \\ x _ {2} + \frac {(r _ {0} \cos^ {2} \theta + p) d x _ {2} - (r _ {0} \cos \theta \sin \theta) d x _ {1}}{p + r _ {0}} \end{array} \right). \\ \end{array}
$$