The Probability Density Function of Bearing Obtained from a Cartesian-to-Polar Transformation

The problem of tracking a two-dimensional Cartesian state of a target using polar observations is well known. At a close range, a traditional extended Kalman filter (EKF) can fail owing to nonlinearity introduced by the Cartesian-to-polar transformation in the observation prediction step of the filter. This is a byproduct of the nonlinear transformation acting on the state variables, which make up a bivariate Gaussian distribution. The nonlinear transformation in question is the arctangent of Cartesian state variables X and Y, which corresponds to the target bearing. At long range, the bearing behaves as a wrapped Gaussian random variable, and behaves well for the EKF. At close range, the bearing is shown to be non-Gaussian, converging to the wrapped uniform distribution when X and Y are uncorrelated. This study provides a concise derivation of the probability density function (PDF) for bearing for the EKF observation prediction step and explores the limiting behavior for this distribution while parameterizing the target range.


I. INTRODUCTION
In radar target tracking applications [2][3] [9], a Kalman filter (KF) is often used to track objects within the field of view of a sensor. In this context, sensors typically deliver measurements in polar coordinates. However, the state vector of the object being tracked is typically defined in Cartesian coordinates. This necessitates a Cartesian to polar transformation to make predictions for the sensor measurements.
The azimuthal angle, or bearing, can be computed using only the coordinates in the east-north (EN) plane; the coordinate system is shown in Figure 1. This coordinate transformation requires one to take an inverse tangent where X and Y are elements of a vector X and compose the bivariate Gaussian distribution ~( , ),  X μΣ (2) where the mean and covariance are    (4) The bearing of the target (Θ) described in (1) is a random variable that behaves as a wrapped Gaussian [19] at long range. For Sections II and III random variables are referred to with capital letters, whereas deterministic variables are lowercase. When the target approaches the origin (collocated with the sensor), the variance increases, and the distribution for Θ resembles a uniform (-π,π] random variable. As the behavior becomes less Gaussian, the bearing prediction begins to diverge and can lead to poor tracking accuracy for the KF. This problem can be ameliorated using a debiased converted measurement filter [1], [3], [16], which converts the polar measurements to Cartesian coordinates prior to executing the algorithm. Another approach is to maintain the filter state in polar coordinates, as was done in [10] [11], thereby avoiding polar-to-Cartesian conversion in exchange for maintaining a nonlinear dynamic model. A third alternative is to use observation only (O2) inference to infer the state directly from the observations [17].
The Monte Carlo samples of X and Y for a radially inbound trajectory drawn from the PDF given in (2) are shown in the left half of Figure 2. For simplicity, X and Y are considered uncorrelated with equal variance for this example. Clearly, the bearing samples calculated from the Cartesian samples using (1) diverge at close range, as shown in the right half of Figure  2. The available literature has already explored aspects of the distributions resulting from the Cartesian to polar transformation [12]. For instance, the Cauchy distribution is also the ratio distribution for two independent, zero-mean Gaussian-distributed random variables. Several authors have performed statistical analyses of the Cauchy distribution [4] [20], but the arctangent of a Cauchy distributed random variable only represents the end-game behavior of Θ at the zero range and assumes that X and Y are independent.
Other authors have explored the properties of the arctangent distribution and its relationship with the folded standard Gaussian distribution [22]. These results have value, but do not address the more general wrapped Gaussian distribution or its application to target tracking performance.
While we focus on the target bearing in this study, it should be noted that for the target range (R) given by 22 , where X and Y are drawn from (2), and the probability distribution is a bivariate non-central chi distribution [15]. This distribution simplifies to the well-known Rice distribution [23] when X and Y are independent, with equal variance σ 2 .
In the following sections, we focus on the derivation of the PDF of the bearing and its effect on the Kalman filter performance. The derivation is presented in Section II. The asymptotic behavior of the distribution as the target approaches the origin is examined in Section III. The implications of the asymptotic behavior of the bearing for a Cartesian EKF with polar measurements are discussed in IV.

II. DERIVATION OF THE PROBABILITY DENSITY FUNCTION FOR BEARING
Some authors, such as Haug, have already attempted to derive a density similar to the one desired here. However, the precise PDF for the bearings was not properly determined in [8] [9]. Improper use of the direct transformation given in (1) causes a loss of sign information when taking the quotient of two variables because the inverse tangent function is periodic over (-π/2,π/2), not the full circle. Mallick [18] pointed out in a recent note that the true transformation used in many tracking applications is the four-quadrant inverse tangent, despite many books, journals, and conferences writing the measurement function as in (1). In practice, a four-quadrant inverse tangent (such as that used in MATLAB) is used.
Using the two-quadrant inverse tangent, as Haug did in [8] [9] results in PDFs with peaks centered on the true bearing as well as the true bearing ±π, as shown in Figure 3. Further analysis shows that the PDF in [9] integrates to two over the full support, disqualifying it as a true PDF. This study uses simple polar relations and variable transformations to obtain the PDF of a bearing random variable derived from a Cartesian to polar transformation. The PDF for the bearing can be used to assess the viability of the Gaussian assumption for the bearing as a function of range.
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/ACCESS.2022.3161974, IEEE Access VOLUME XX, 2017 9 The development of the PDF for bearing begins with the polar-to-Cartesian transformations of R and Θ into X and Y in an EN coordinate system given by sin( ), XR  (8) and cos( ). YR  (9) For convenience later in the derivation, it was helpful to redefine the mean values of X and Y in terms of their polar equivalents. Specifically, we define a mean target range μR with (7) and mean bearing μΘ such that The joint distribution for X and Y can be written as Substituting the results of (8)- (12) into (13) A change of variable [5] can now be performed to obtain the joint distribution in polar coordinates, fRΘ(r,θ), using where J(r,θ) is the Jacobian [21] of the transformation equations (8)-(9) given by: The joint PDF for R and Θ can be simplified by completing the square in the exponential argument to obtain To obtain the marginal PDF of Θ, we integrate (22) with the support of R, resulting in: Using standard integral methods or referring to [6], we can obtain the marginal distribution for Θ: where Ф(x) is the cumulative distribution function (CDF) of the standard Gaussian distribution N(0,1). When X and Y are uncorrelated (ρ = 0) with equal variance The asymptotic behaviors of the general PDF (25) and simplified PDF (26) are discussed in Section III.

III. ASYMPTOTIC BEHAVIOR OF THE BEARING DISTRIBUTION
The mixed uniform and Gaussian behavior of the distribution given in Equation (26) may not be immediately obvious. It only becomes so by observing the asymptotic behavior of each term in (26) with respect to μR. The first term of (26) is designated as fΘ (1) (θ), and the second term as fΘ (2)   A simple test can be used to demonstrate that the PDF of Θ behaves like the wrapped Gaussian distribution in (41). Figure  4 shows that as the ratio μR/σ increases (where the true σ is constant), the sample standard deviation (represented by the blue dots in Figure 4) quickly converges to the approximated standard distribution. From the plot in Figure 4, the difference becomes indistinguishable at approximately μR/σ = 5. The approximated standard deviation was obtained by taking the square root of the variance from (43), whereas the true standard deviation refers to the standard deviation of the samples found on the right-hand side of Figure 2.
A plot of the bearing PDF from Equation (26) for various bearing values and mean ranges is shown in Figure 5. A careful inspection of the plot in Figure 5 reveals that the distribution is a wrapped Gaussian centered on the nominal bearing (μΘ = 45 °) when μR is large. It can be seen that as μR decreases the PDF transitions from that of a wrapped Gaussian with support (-π,π] to Uniform over the same support. The asymptotic behavior of the generalized version of the distribution (25) is not as convenient as that of the simplified version. At long range, the distribution is somewhat similar to a wrapped Gaussian, but for the sake of simplicity, this paper will focus on the behavior of the distribution at close range.
The key finding from this section relates to the expected value of the distribution The conclusion drawn in (42) The right-hand side of (47) is a function of θ because of the presence of a(θ), and is unlike (34). However, simple trigonometric identities can be used to show that a(θ) is twice periodic over (-π,π]. Thus, (42) also applies to the generalized version of the distribution in (25). This result can also be computed explicitly using the method to find the moments of wrapped random variables [19]. An example of the distribution at zero range is shown in Figure 6. Curiously, the distribution for the case in Figure 6 resembles the incorrect distribution shown in Figure 3. However, the dual peaks in Figure 3 are due to the ambiguity introduced by the arctangent function in general, while the peaks in Figure 6 are artifacts caused by a(θ). This distribution also integrates to unit area, unlike the incorrect distribution presented earlier.
In the next section, it will be shown how (42) impacts the Kalman filter position estimates and causes them to become lose accuracy at close ranges.

IV. IMPACT ON KALMAN FILTER PERFORMANCE
The Kalman filter algorithm is well known to perform optimally for linear functions of Gaussian distributed variables [13]. A Cartesian KF, which relies on measurements in polar coordinates, clearly violates the linearity requirement owing to nonlinear functions (1) and (5).
The state model is described by   This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. where q denotes the process noise intensity. In practice, the process noise intensity is selected by the filter developer to account for the uncertainty of the dynamic model. This tuning parameter directly influences the position variance terms on the main diagonal of the predicted covariance (53). The observation model is where the vector w is Gaussian distributed with zero mean and covariance matrix S and is assumed to be independent of v. The covariance matrix for the observations is often treated as independent for the range and bearing measurements In Section III that the resulting distribution for the bearing will appear Gaussian at long range, and progressively less Gaussian as μR shrinks. Given the knowledge of the probability density of the target state for all prior measurements p(xn|z1:n-1), the predicted bearing approaches zero at close range,  [7].
Another key takeaway is that increasing the process noise has the same effect as decreasing μR, and vice versa, because of its direct impact on the variance terms in (16)- (18). This means that a filter designer can unintentionally decrease the accuracy of their EKF if they are not judicious in their selection of the tuning parameter q given their measurement update period constraints.
In many target-tracking applications, target maneuvers are not known a priori; therefore, they are often modeled as random accelerations in the CV model. A filter designer focused on tracking a maneuvering inbound target must include appropriate levels of process noise to account for these maneuvers based on the knowledge of the target's maneuverability. However, a combination of large process noise and closing the target range can have a negative impact on the filter performance owing to the combination of nonlinear and non-Gaussian behavior of the bearing model.
Many have chosen to address the nonlinearity of h(xn) for mixed Cartesian and polar tracking problems using the EKF [11][14] [24]. In the EKF formulation, the estimate of (55) is simplified as However, linearizing the filter about the state and covariance does not address the fact that, at a close range, the arctangent function is still quite nonlinear.
To demonstrate the effects of range and process noise on the tracking performance, a series of simple experiments were performed using a CV Cartesian EKF to track a simulated radially inbound target (approaching the sensor origin at a 45° angle clockwise from north) with range and bearing measurements. RMS position error statistics were collected over the course of 100 Monte Carlo runs, where measurements were generated by adding Gaussian random errors consistent with Equation (56) to the truth trajectory. FIGURE 7 demonstrates the impact of the nonlinearity of the bearing at close range as well as the impact of varying the process noise. The results of this simple experiment were in agreement with the findings of Haug and Williams [11]. In their study, the error performance for a variety of Cartesian and spherical tracking filters showed that, at close range, the tracks that relied on a Cartesian-to-spherical transformation tended to diverge, unlike the fully spherical filters. The results are also