## Update If I understood your model, you have a model of Constant Velocity in 2D (Cartesian Coordinate System). While your measurement are in Polar Coordinate System. Pay attention that your measurement function is: $$ h \left( x, y, {v}_{x}, {v}_{y} \right) = \begin{bmatrix} \sqrt{ {x}^{2} + {y}^{2} } \\ {\tan}^{-1} \left( \frac{y}{x} \right ) \end{bmatrix} $$ Hence you Jacobian becomes: $$\begin{aligned} {J}_{h} \left( x, y, {v}_{x}, {v}_{y} \right) & = \begin{bmatrix} \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial x} & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial y} & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial {v}_{x}} & \frac{\partial \sqrt{ {x}^{2} + {y}^{2} } }{\partial {v}_{y}} \\ \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial x} & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial y} & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial {v}_{x}} & \frac{\partial {\tan}^{-1} \left( \frac{y}{x} \right ) }{\partial {v}_{y}} \end{bmatrix} \\ & = \begin{bmatrix} \frac{x}{ \sqrt{ {x}^{2} + {y}^{2} } } & \frac{y}{ \sqrt{ {x}^{2} + {y}^{2} } } & 0 & 0 \\ -\frac{y}{{x}^{2} + {y}^{2}} & \frac{x}{{x}^{2} + {y}^{2}} & 0 & 0 \end{bmatrix} \end{aligned}$$ The function of the measurement is the one connecting your state vector into the measurement and not the other way around. Let's look on Wikipedia EKF Model: [![enter image description here][1]][1] [![enter image description here][2]][2] In you case $ F $ is constant is the model is linear. What's in Wikipedia called $ H $ is the $ J $ I derived above. Dimension wise, all is perfectly defined. ## Implementation I implemented a general Kalman Filter Iteration with support for Extended Kalman Filter (With option for Numeric Calculation of the Jacobian). I also added option to Unsecented Kalman Filter (UKF) Iteration, so you will be able to compare. Here is a result in with the same model as yours: [![enter image description here][3]][3] The full code is available on my [StackExchange Signal Processing Q51386 GitHub Repository][4] (Look at the `SignalProcessing\Q51386` folder). 24/08/2018: I added UKF implementation which is pretty general so you could use it in various models. ## Original Answer Converting coordinate system is the main reason the Extended Kalman Filter was invented. Let me give you a tip, it doesn't work well in those cases. If you use Non Linear Transformation use something that will both make things easier and better (Yea, usually it doesn't work like that, but in this case it does) - Use the Unscented Kalman Filter (UKF) which is based on the [Unscented Transform][5]. Once you utilize that there is no need to derive the Jacobian. All needed is to apply the non linear function $ n $ times (On each Sigma Point). It is easy to see that linearization doesn't work well for propagating the mean and the covariance in many (Most) cases. The UKF directly approximate the calculation of the integration of the non linear function which calculates the mean and covariance. It will make things easier as you'll be able to skip the linearization step and only know the coordinate transformation function. In modern tracking we usually stay away from EKF and utilize methods which better approximate the integrals of the first 2 moments propagation. The most common ones are the UKF and GHKF (Those are called Sigma Points Kalman filters). Their generalization is the Particle Filter which in most cases is over kill. **Update** Have a look at [EKF / UKF Maneuvering Target Tracking using Coordinated Turn Models with Polar/Cartesian Velocity][6]. From their conclusion: > We have shown a range of coordinated turn (CT) models using either Cartesian or polar velocity and how to use them in a Kalman filtering framework for maneuvering target tracking. > The results of the conducted simulation study are in favor of polar velocity. This confirms the results of the previous study [11] and extends it to the case of varying target speed. For polar CT models, the performance in terms of position RMSE of the predicted state appears to be comparable for EKF and UKF. As the UKF does not require the derivation and implementation of Jacobians it might be more straightforward to implement. The RMSE provided by the Cartesian velocity EKF and UKF turned out slightly worse. Interestingly, the sensitivity of the RMSE with respect to the noise parameters was decreased by using EKF2 and UKF in the Cartesian case. This, in addition to the simpler implementation and lower computational cost of UKF over EKF2 results in a recommendation for UKF if Cartesian CT models are preferred. Basically telling you, don't bother with Jacobians, just use the simpler UKF. Another comparison is made at Implementation of the Unscented Kalman Filter and a simple Augmentation System for GNSS SDR receivers with: > As can be seen, UKF implementation does not require linearization (state transition function and measurements functions are directly applied to sigma points) and it can also work in presence of discontinuities. The prediction only consists of linear algebra operations. All such advantages are fundamental for minimizing computational load in an SDR implementation. > While the classical Kalman Filter implies the propagation of n components for the state vector and n2 /2+n/2 components for the Covariance matrix, the UKF requires the propagation of 2n+1 sigma points only. > Furthermore, UKF is more insensitive to initial conditions with respect to EKF. It has been demonstrated that UKF rapidly converge also in presence of an initial position error of several Kilometers. [1]: https://i.sstatic.net/zuCGn.png [2]: https://i.sstatic.net/1pc4Z.png [3]: https://i.sstatic.net/NgChp.png [4]: https://github.com/RoyiAvital/StackExchangeCodes [5]: https://en.wikipedia.org/wiki/Unscented_transform [6]: http://liu.diva-portal.org/smash/get/diva2:734112/FULLTEXT01.pdf