# Sensitivity Analysis for Gaussian-Associated Features
## 3 Least-Squares (LS) Feature Assessment  
See also, e.g., [24; 25; 26; 27]. Suppose \(\mathbf{u}\mapsto\mathbf{s}(\mathbf{u},\mathbf{a})\) defines a parametric curve or surface. The parameters \(\mathbf{u}\) determine the position of a point on the surface and the parameters \(\mathbf{a}\) determine the shape and position of the surface. We assume that set of measured coordinates, \(\mathbf{x}_{1:m}\) nominally represent points on such a surface, so that  
\[\mathbf{x}_{i}\approx\mathbf{s}(u_{i},\mathbf{a}), \tag{6}\]for some \(\mathbf{u}_{i}\) and some \(\mathbf{a}\). The least-squares (LS) estimates \(\hat{\mathbf{u}}_{1:m}\) and \(\hat{\mathbf{a}}\) of \(\mathbf{u}_{1:m}\) and \(\mathbf{a}\), respectively, can be found by minimizing  
\[\sum_{i=1}^{m}d^{2}(\mathbf{x}_{i},\mathbf{a}),\quad d(\mathbf{x}_{i},\mathbf{a})=(\mathbf{x}_{i}- \mathbf{s}(\mathbf{u}_{i}^{*},\mathbf{a}))^{\top}\mathbf{u}_{i}, \tag{7}\]  
where \(\mathbf{u}_{i}^{*}\) specifies the point \(\mathbf{s}_{i}^{*}=\mathbf{s}(\mathbf{u}_{i}^{*},\mathbf{a})\) on the surface closest to \(\mathbf{x}_{i}\) and \(\mathbf{n}_{i}\) is the normal vector at \(\mathbf{s}_{i}^{*}\). The term least-squares orthogonal distance regression (LSODR) is also used for this type of optimization problem [28, 29] as \(d(\mathbf{x}_{i},\mathbf{a})\) is the (signed) distance of \(\mathbf{x}_{i}\) from the surface \(\mathbf{s}(\mathbf{u},\mathbf{a})\) measured orthogonally to the surface. For standard geometric elements, \(d(\mathbf{x},\mathbf{a})\) can be evaluated analytically [24]. The geometric elements considered in this paper are: circle in the \(xy\)-plane, plane, sphere, cylinder and cone [15, 24]. For more general surfaces, numerical methods are required [27]. Let \(J=J(\mathbf{x}_{1:m},\mathbf{a})\) be the Jacobian matrix defined by  
\[J_{ij}=\frac{\partial d}{\partial a_{j}}(\mathbf{x}_{i},\mathbf{a}).\]  
The optimality conditions for \(\mathbf{a}\) to minimize the sum of squares in (7) are of the form  
\[J^{\top}\mathbf{d}=\mathbf{0},\quad J=J(\mathbf{x}_{1:m},\mathbf{a}),\quad d_{i}=d(\mathbf{x}_{i},\mathbf{a}).\]  
These optimality conditions implicitly define the solution \(\mathbf{a}\) as function of the data points \(\mathbf{x}_{1:m}\) and allow us to evaluate the sensitivity matrix \(G_{A|X}\) of \(\mathbf{a}\) with respect to the data Section 4.2.4 [30]. If \(J\) is the Jacobian matrix and \(\mathbf{n}_{i}\) are the corresponding surface normals at the solution \(\hat{\mathbf{u}}_{1:m}\) and \(\hat{\mathbf{a}}\) then  
\[G_{A|X}=G_{A|D}N^{\top},\quad G_{A|D}=-(J^{\top}J)^{-1}J^{\top}, \tag{8}\]  
where \(N\) is the \(3m\times m\) block diagonal matrix storing the normal vectors \(\mathbf{n}_{i}\) in the \(3\times 1\) diagonal blocks. The matrix \(n\times m\)\(G_{A|D}\) is the sensitivity matrix of the parameters \(\mathbf{a}\) with respect to changes in \(\mathbf{x}_{i}\) in the direction orthogonal to the fitted surface. If QR factorization [31] of \(J\) is given by  
\[J=QR=[Q_{1}\;Q_{2}]\left[ \begin{array}{c}R_{1}\\ \mathbf{0}\end{array} \right], \tag{9}\]  
where \(Q\) is orthogonal and \(R_{1}\) is upper-triangular, then  
\[G_{A|D}=-R_{1}^{-1}Q_{1}^{\top}.\]  
If \(V_{X}\) is the variance matrix associated with \(\mathbf{x}_{1:m}\), then the variance matrix associated with the features \(\mathbf{a}\) is given by  
\[V_{A}=G_{A|X}V_{X}G_{A|X}^{\top}.\]  
If \(V_{X}\) is the diagonal matrix \(\sigma_{R}^{2}I\), then  
\[V_{A}=\sigma_{R}^{2}(J^{\top}J)^{-1}=\sigma_{R}^{2}(R_{1}^{\top}R_{1})^{-1}, \tag{10}\]  
using the fact that \(N^{\top}N=I\). Weighted Least-Squares Orthogonal Distance Regression  
It is sometimes useful to incorporate weights \(w_{i}\geq 0\) into the orthogonal distance regression scheme so that the counterpart of (7) is  
\[\sum_{i=1}^{m}w_{i}^{2}d^{2}(\mathbf{x}_{i},\mathbf{a}),\quad d(\mathbf{x}_{i},\mathbf{a})=( \mathbf{x}_{i}-\mathbf{s}(\mathbf{u}_{i}^{*},\mathbf{a}))^{\top}\mathbf{n}_{i}. \tag{11}\]Let \(W\) be the diagonal matrix with \(w_{i}^{2}\) in the \(i\)th diagonal element.