# Sensitivity Analysis for Gaussian-Associated Features
## 4 Sensitivity Matrix Associated with a Least-Squares Circle Fit to Data in a Plane  
If a circle is parametrized by \(\mathbf{a}=(x_{0},y_{0},r_{0})^{\top}\) specifying its center coordinates \(\mathbf{x}_{0}=(x_{0},y_{0})^{\top}\) and radius \(r_{0}\), the signed distance \(d(\mathbf{x}_{i},\mathbf{a})\) from a data point \(\mathbf{x}_{i}\) to the circle specified by \(\mathbf{a}\) is  
\[d(\mathbf{x}_{i},\mathbf{a})=r_{i}-r_{0},\]  
where \(r_{i}^{2}=(x_{i}-x_{0})^{2}+(y_{i}-y_{0})^{2}\). The \(i\)th row Jacobian matrix \(J\) of partial derivatives of \(d(\mathbf{x}_{i},\mathbf{a})\) with respect to \(\mathbf{a}^{\top}\) is given by  
\[J(i,:)=-\frac{1}{r_{i}}[x_{i}-x_{0},\;y_{i}-y_{0},\;r_{i}]=-[\mathbf{n}_{i}^{\top },\;1],\quad\mathbf{n}_{i}=(\mathbf{x}_{i}-\mathbf{x}_{0})/r_{i}\]  
The \(3\times 3\) matrix \(H=J^{\top}J\) is given by  
\[H=\bigg{[} \begin{array}{cc}\sum_{i}\mathbf{n}_{i}\mathbf{n}_{i}^{\top}&\sum_{i}\mathbf{ n}_{i}\\ \sum_{i}\mathbf{n}_{i}^{\top}&m\end{array} \bigg{]}.\]  
The sensitivity matrix \(G_{A|X}=H^{-1}J^{\top}N^{\top}\) where  
\[J^{\top}N^{\top}=-\bigg{[} \begin{array}{cccc}\mathbf{n}_{1}\mathbf{n}_{1}^{\top}&\bm {n}_{2}\mathbf{n}_{2}^{\top}&\cdots&\mathbf{n}_{m}\mathbf{n}_{m}^{\top}\\ \mathbf{n}_{1}^{\top}&\mathbf{n}_{2}^{\top}&\cdots&\mathbf{n}_{m}^{\top}\end{array} \bigg{]}. \tag{13}\]  
Thus, perturbing \(\mathbf{x}_{i}\) by \(\Delta\mathbf{x}_{i}\) causes \(\mathbf{x}_{0}\) and \(r_{0}\) to be perturbed by an amount that depends on extend to which \(\Delta\mathbf{x}_{i}\) is aligned with the normal \(\mathbf{n}_{i}\). For points \(\mathbf{x}_{i}\) approximately uniformly distributed around the circle, \(H\) is approximately diagonal with  
\[H\approx m\left[ \begin{array}{ccc}1/2&0&0\\ 0&1/2&0\\ 0&0&1\end{array} \right],\quad H^{-1}\approx\frac{1}{m}\left[ \begin{array}{ ccc}2&0&0\\ 0&2&0\\ 0&0&1\end{array} \right]. \tag{14}\]  
Thus, if \(V_{X}=\sigma_{R}^{2}I\) then, from (10), \(V_{A}=\sigma_{R}^{2}H^{-1}\), showing that the variances associated with \(\mathbf{a}\) vary with \(1/m\) and that the variance associated with \(\mathbf{x}_{0}\) is twice that associated with \(r_{0}\), for a uniform distribution of points. Analytical Approximations for (An Arc Of) a Circle  
The calculation of \(H\) in (14) is for the case of points uniformly distributed around a complete circle. Similar but more complicated calculations can be made for points on a partial circle, including the often-problematic case of a small arc of a circle. For these calculations, it is often convenient to work in polar coordinates. For points \((x_{i},y_{i})^{\top}=r_{0}(\cos\theta_{i},\sin\theta_{i})^{\top}\) on a circle, the corresponding contribution to the Jacobian matrix is the row \((-\cos\theta_{i},-\sin\theta_{i},-1)\) and the matrix \(H=J^{\top}J\) is given by  
\[H=\left[ \begin{array}{ccc}\sum_{i}\cos^{2}\theta_{i}&\sum_{i}\cos\theta_{i} \sin\theta_{i}&\sum_{i}\cos\theta_{i}\\ \sum_{i}\cos\theta_{i}\sin\theta_{i}&\sum_{i}\sin^{2}\theta_{i}&\sum_{i}\sin \theta_{i}\\ \sum_{i}\cos\theta_{i}&\sum_{i}\sin\theta_{i}&m\end{array} \right].\]  
The principle of Monte Carlo integration [22] Section 7.7 states that for a function \(f(\theta)\) defined over a region \(A\) the integral of the function over the region can be approximated according to  
\[\frac{1}{|A|}\int_{A}f(\theta)\mathrm{d}\theta\approx\frac{1}{m}\sum_{i=1}^{m }f(\theta_{i}), \tag{15}\]  
where \(\theta_{1:m}\) is a sample of points uniformly distributed over the region \(A\) and \(|A|\) is the area/volume of the region. We can use this approximation in the other direction to approximate \(H\) derived from a discrete set of points from analytically derived integrals. For example, suppose points \(\mathbf{x}_{1:m}\) are approximately uniformly distributed of the arc of the circle defined by \(-\alpha\leq\theta_{i}\leq\alpha\). Then  
\[\sum_{i=1}^{m}\cos^{2}\theta_{i}\approx\frac{m}{2\alpha}\int_{-\alpha}^{\alpha }\cos^{2}\theta\mathrm{d}\theta=m\bigg{(}\frac{1}{2}+\frac{\sin 2\alpha}{4 \alpha}\bigg{)};\]  
see Appendix A.