Next Article in Journal
On the Digital Cohomology Modules
Previous Article in Journal
MINE: Identifying Top-k Vital Nodes in Complex Networks via Maximum Influential Neighbors Expansion
Previous Article in Special Issue
Stochastic Properties of Confidence Ellipsoids after Least Squares Adjustment, Derived from GUM Analysis and Monte Carlo Simulations
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Weighted Total Least Squares (WTLS) Solutions for Straight Line Fitting to 3D Point Data

1
Institute of Geodesy and Geoinformation Science, Technische Universität Berlin, Strasse des 17. Juni 135, 10623 Berlin, Germany
2
GFZ German Research Centre for Geosciences, Section 1.2: Global Geomonitoring and Gravity Field, Telegrafenberg, 14473 Potsdam, Germany
*
Author to whom correspondence should be addressed.
Mathematics 2020, 8(9), 1450; https://doi.org/10.3390/math8091450
Submission received: 14 July 2020 / Revised: 20 August 2020 / Accepted: 25 August 2020 / Published: 29 August 2020
(This article belongs to the Special Issue Stochastic Models for Geodesy and Geoinformation Science)

Abstract

:
In this contribution the fitting of a straight line to 3D point data is considered, with Cartesian coordinates x i , y i , z i as observations subject to random errors. A direct solution for the case of equally weighted and uncorrelated coordinate components was already presented almost forty years ago. For more general weighting cases, iterative algorithms, e.g., by means of an iteratively linearized Gauss–Helmert (GH) model, have been proposed in the literature. In this investigation, a new direct solution for the case of pointwise weights is derived. In the terminology of total least squares (TLS), this solution is a direct weighted total least squares (WTLS) approach. For the most general weighting case, considering a full dispersion matrix of the observations that can even be singular to some extent, a new iterative solution based on the ordinary iteration method is developed. The latter is a new iterative WTLS algorithm, since no linearization of the problem by Taylor series is performed at any step. Using a numerical example it is demonstrated how the newly developed WTLS approaches can be applied for 3D straight line fitting considering different weighting cases. The solutions are compared with results from the literature and with those obtained from an iteratively linearized GH model.

1. Introduction

Modern geodetic instruments, such as terrestrial laser scanners, provide the user directly with 3D coordinates in a Cartesian coordinate system. However, in most cases these 3D point data are not the final result. For an analysis of the recorded data or for a representation using computer-aided design (CAD), a line, curve or surface approximation with a continuous mathematical function is required.
In this contribution the fitting of a spatial straight line is discussed considering the coordinate components x i , y i , z i of each point P i as observations subject to random errors, which results in a nonlinear adjustment problem. An elegant direct least squares solution for the case of equally weighted and uncorrelated observations has already been presented in 1982 by Jovičić et al. [1]. Unfortunately, this article was very rarely cited in subsequent publications, which is probably due to the fact that it was written in Croatian language. Similar least squares solutions, direct as well, have been published by Kahn [2] and Drixler ([3], pp. 46–47) some years later. In these contributions, it was shown that the problem of fitting a straight line to 3D point data can be transformed into an eigenvalue problem. An iterative least squares solution for fitting a straight line to equally weighted and uncorrelated 3D points has been presented by Späth [4], by minimizing the sum of squared orthogonal distances of the observed points to the requested straight line.
For more general weighting schemes iterative least squares solutions have been presented by Kupferer [5] and Snow and Schaffrin [6]. In both contributions various nonlinear functional models were introduced and tested and the Gauss-Newton approach has been employed for an iterative least squares solution, which involves the linearization of the functional model to solve the adjustment problem within the Gauss–Markov (GM) or the Gauss–Helmert (GH) models. The linearization of originally nonlinear functional models is a very popular approach in adjustment calculation, where the solution is then determined by iteratively linearized GM or GH models, see e.g., the textbooks by Ghilani [7], Niemeier [8] or Perovic [9]. Pitfalls to be avoided in the iterative adjustment of nonlinear problems have been pointed out by Pope [10] and Lenzmann and Lenzmann [11].
Fitting a straight line to 3D point data can also be considered as an adjustment problem of type total least squares (TLS) for an errors-in-variables (EIV) model, as already pointed out by Snow and Schaffrin [6]. For some weighting cases, problems expressed within the EIV model can have a direct solution using singular value decomposition (SVD). This solution is known under the name Total Least Squares (TLS) and has been firstly proposed by Golub and Van Loan [12], Van Huffel and Vandewalle [13] or Van Huffel and Vandewalle ([14], p. 33 ff.). The TLS solution is obtained by computing the roots of a polynomial, i.e., by solving the characteristic equation of the eigenvalues, which is identical in the case of fitting a straight line to 3D point data to the solutions of Jovičić et al. [1], Kahn [2] and Drixler ([3], pp. 46–47). This is something that has been observed by Malissiovas et al. [15], where a relationship has been presented between TLS and the direct least squares solution of the same adjustment problem, while postulating uncorrelated and equally weighted observations.
To involve more general weight matrices in the adjustment procedure, iterative algorithms have been presented in the TLS literature without linearizing the underlying problem by Taylor series at any step of the solution process. These are algorithmic approaches known as weighted total least squares (WTLS), presented e.g., by Schaffrin and Wieser [16], Shen et al. [17] or Amiri and Jazaeri [18]. A good overview of such algorithms, as well as alternative solution strategies can be found in the dissertation theses of Snow [19] and Malissiovas [20]. An attempt to find a WTLS solution for straight line fitting to 3D point data was made by Guo et al. [21].
To avoid confusion, it is to clarify that the terms TLS and WTLS refer to algorithmic approaches for obtaining a least squares solution, which is either direct or iterative but without linearizing the problem by Taylor series at any step. This follows the statement of Snow ([19], p. 7), that “the terms total least-squares (TLS) and TLS solution […] will mean the least-squares solution within the EIV model without linearization”. Of course, a solution within the GH model is more general in the sense that it can be utilized to solve any nonlinear adjustment problem, while TLS and WTLS algorithms can treat only a certain class of nonlinear adjustment problems. This has been firstly discussed by Neitzel and Petrovic [22] and Neitzel [23], who showed that the TLS estimate within an EIV model can be identified as a special case of the method of least squares within an iteratively linearized GH model.
To the extent of our knowledge, a WTLS algorithm for fitting a straight line to 3D point data has not been presented yet. Therefore, in this study we derive two novel WTLS algorithms for the discussed adjustment problem considering two different cases of stochastic models:
(i)
pointwise weights, i.e., coordinate components with same precision for each point and no correlations between them,
(ii)
general weights, i.e., correlated coordinate components of individual precision including singular dispersion matrices.
The adjustment problem resulting from case (i) can still be solved directly, i.e., a direct WTLS solution, presented in Section 2.1 of this paper. For case (ii) an iterative solution without linearizing the problem by Taylor series is derived in Section 2.2, i.e., an iterative WTLS solution. Both solutions are based on the work of Malissiovas [20], where similar algorithms have been presented for the solution of other typical geodetic tasks, such as straight line fitting to 2D point data, plane fitting to 3D point data and 2D similarity coordinate transformation. The WTLS solution for straight line fitting to 3D point data will be derived from a geodetic point of view by means of introducing residuals for all observations, formulating appropriate condition and constraint equations, setting up and solving the resulting normal equation systems.

2. Straight Line Fitting to 3D Point Data

A straight line in 3D space can be expressed by
y y 0 a = x x 0 b = z z 0 c ,
as explained e.g., in the handbook of mathematics by Bronhstein et al. ([24], p. 217). This equation defines a line that passes through a point with coordinates x 0 , y 0 and z 0 and is parallel to a direction vector with components a, b and c. Since the number of unknown parameters is six, two additional constraints between the unknown parameters have to be taken into account for a solution, as Snow and Schaffrin [6] have clearly explained. Proper constraints will be selected at a later point of the derivations.
Considering an overdetermined configuration for which we want to obtain a least squares solution, we introduce for all points P i residuals v x i , v y i , v z i for the observations x i , y i , z i assuming that they are normally distributed with v ( 0 , σ 0 2 Q LL ) . Here the 1 × 3 n vector v contains the residuals v x i , v y i , v z i , Q LL is the 3 n × 3 n corresponding cofactor matrix and σ 0 2 the theoretical variance factor. Based on (1), the nonlinear conditions equations
a ( x i + v x i x 0 ) b ( y i + v y i y 0 ) = 0 , b ( z i + v z i z 0 ) c ( x i + v x i x 0 ) = 0 , c ( y i + v y i y 0 ) a ( z i + v z i z 0 ) = 0 ,
can be formulated for each point P i , with i = 1 , , n and n being the number of observed points. A functional model for this problem can be expressed by two of these three nonlinear condition equations per observed point. Using all three condition equations for solving the problem would lead to a singular normal matrix due to linearly dependent normal equations.

2.1. Direct Total Least Squares Solution for Equally Weighted and Uncorrelated Observations

Considering all coordinate components x i , y i , z i for all points P i as equally weighted and uncorrelated observations with
p y i = p x i = p z i = 1 i ,
a least squares solution can be derived by minimizing the objective function
Ω = i = 1 n v x i 2 + v y i 2 + v z i 2 min .
A direct least squares solution of this problem, respectively a TLS solution, has been presented by Malissiovas et al. [15] and Malissiovas [20]. According to these investigations, equally weighted residuals correspond to the normal distances
D i 2 = v x i 2 + v y i 2 + v z i 2 ,
as deviation measures between the observed 3D point cloud and the straight line to be computed. Thus, the objective function can be written equivalently as
Ω = i = 1 n v x i 2 + v y i 2 + v z i 2 = i = 1 n D i 2 min .
An expression for the squared normal distances
D 2 = a ( x x 0 ) b ( y y 0 ) 2 + b ( z z 0 ) c ( x x 0 ) 2 + c ( y y 0 ) a ( z z 0 ) 2 a 2 + b 2 + c 2 ,
can be found in the handbook of Bronhstein et al. ([24], p. 218).
An appropriate parameterization of the problem involves the substitution of the unknown parameters y 0 , x 0 and z 0 with the coordinates of the center of mass of the observed 3D point data. A proof for this parameter replacement has been given by Jovičić et al. [1] and concerns only the case of equally weighted and uncorrelated observations. A solution for the line parameters can be computed by minimizing the objective function (6), under the constraint
a 2 + b 2 + c 2 = 1 ,
or by searching for stationary points of the Lagrange function
K = i = 1 n D i 2 k ( a 2 + b 2 + c 2 1 ) ,
with k denoting the Lagrange multiplier. The line parameters can be computed directly from the normal equations, either by solving a characteristic cubic equation or an eigenvalue problem. A detailed explanation of this approach was given by Malissiovas ([20], p. 74 ff.). In the following subsections we will give up the restriction of equally weighted and uncorrelated coordinate components and derive least squares solutions considering more general weighting schemes for the observations.

2.2. Direct Weighted Total Least Squares Solution

In this case we consider the coordinate components x i , y i , z i of each point P i to be uncorrelated and of equal precision with
σ y i = σ x i = σ z i = σ i i ,
yielding the corresponding (pointwise) weights
p i = 1 σ i 2 i .
A least squares solution of the problem can be found by minimizing the objective function
Ω = i = 1 n p x i v x i 2 + p y i v y i 2 + p z i v z i 2 min = i = 1 n p i v x i 2 + v y i 2 + v z i 2 min .
Taking into account the relation of the squared residuals with the normal distances of Equation (5), it is possible to express the objective function as
Ω = i = 1 n p i D i 2 min .
Using the constraint (8), the expression of the normal distances can be written as
D i 2 = a ( x i x 0 ) b ( y i y 0 ) 2 + b ( z i z 0 ) c ( x i x 0 ) 2 + c ( y i y 0 ) a ( z i z 0 ) 2 .
A further simplification of the problem is possible, by replacing the unknown parameters y 0 , x 0 and z 0 with the coordinates of the weighted center of mass of the 3D point data
y 0 = i = 1 n p i y i i = 1 n p i , x 0 = i = 1 n p i x i i = 1 n p i , z 0 = i = 1 n p i z i i = 1 n p i .
It can be proven that this parameterization is allowed and possible, following the same line of thinking as in the study of Jovičić et al. [1]. Therefore, for this weighted case we can write the normal distances as
D i 2 = a x i b y i 2 + b z i c x i 2 + c y i a z i 2 ,
with the coordinates reduced to the weighted center of mass of the observed 3D point data
y i = y i i = 1 n p i y i i = 1 n p i , x i = x i i = 1 n p i x i i = 1 n p i , z i = z i i = 1 n p i z i i = 1 n p i .
Searching for stationary points of the Lagrange function
K = i = 1 n D i 2 k ( a 2 + b 2 + c 2 1 ) = i = 1 n a x i b y i 2 + b z i c x i 2 + c y i a z i 2 k ( a 2 + b 2 + c 2 1 )
leads to the system of normal equations
K a = 2 a i = 1 n p i x i 2 + i = 1 n p i z i 2 k 2 b i = 1 n p i y i x i 2 c i = 1 n p i y i z i = 0 ,
K b = 2 b i = 1 n p i y i 2 + i = 1 n p i z i 2 k 2 a i = 1 n p i y i x i 2 c i = 1 n p i x i z i = 0 ,
K c = 2 c i = 1 n p i y i 2 + i = 1 n p i x i 2 k 2 a i = 1 n p i y i z i 2 b i = 1 n p i x i z i = 0 ,
and
K k = a 2 + b 2 + c 2 1 = 0 .
Equations (19) to (21) are a homogeneous system of equations which are linear in the unknown line parameters a, b and c, and has a nontrivial solution if
( d 1 k ) d 4 d 5 d 4 ( d 2 k ) d 6 d 5 d 6 ( d 3 k ) = 0 ,
with the elements of the determinant
d 1 = i = 1 n p i x i 2 + i = 1 n p i z i 2 , d 2 = i = 1 n p i y i 2 + i = 1 n p i z i 2 , d 3 = i = 1 n p i y i 2 + i = 1 n p i x i 2 , d 4 = i = 1 n p i y i x i , d 5 = i = 1 n p i y i z i , d 6 = i = 1 n p i x i z i .
Equation (23) is a cubic characteristic equation with the unknown parameter k and a solution is given by Bronhstein et al. ([24], p. 63). The unknown line parameters a, b and c can be computed either by substituting k min into Equations (19)–(21) under the constraint (22) or by transforming the equation system and solving an eigenvalue problem, i.e., the direct WTLS solution.

2.3. Iterative Weighted Total Least Squares Solution

In this case, we consider the fact that the coordinate components x i , y i , z i of each point P i are not original observations. They are either
(i)
derived from single point determinations, e.g., using polar elementary measurements of slope distance ρ i , direction ϕ i and tilt angle θ i , e.g., from measurements with a terrestrial laser scanner, so that the coordinates result from the functional relationship
x i = ρ i cos ϕ i sin θ i , y i = ρ i sin ϕ i cos θ i , z i = ρ i cos θ i .
Using the standard deviations σ ρ i , σ ϕ i and σ θ i of the elementary measurements, a 3 × 3 variance-covariance matrix can be provided for the coordinate components x i , y i , z i of each point P i by variance-covariance propagation based on (25). Covariances among the n different points do not occur in this case.
or
(ii)
derived from a least squares adjustment of an overdetermined geodetic network. From the solution within the GM or GH model, the 3 n × 3 n variance-covariance matrix of the coordinate components x i , y i , z i of all points P i can be obtained. This matrix is a full matrix, considering also covariances among the n different points. It may even have a rank deficiency in case the coordinates were determined by a free network adjustment.
The variances and covariances from (i) or (ii) can then be assembled in a dispersion matrix
Q LL = Q xx Q xy Q xz Q yx Q yy Q yz Q zx Q zy Q zz ,
for the coordinate components as “derived observations”. In case of a non-singular dispersion matrix, it is possible to compute the respective weight matrix
P = P xx P xy P xz P yx P yy P yz P zx P zy P zz = Q LL 1 .
Starting with the functional model (2), we choose to work with the nonlinear condition equations
c ( y i + v y i y 0 ) a ( z i + v z i z 0 ) = 0 , c ( x i + v x i x 0 ) b ( z i + v z i z 0 ) = 0 .
Two additional constraints must be taken into account in this case. For example, Snow and Schaffrin [6] proposed the constraints
a 2 + b 2 + c 2 = 1 , a y 0 + b x 0 + c z 0 = 0 .
A further development of an algorithmic solution using these constraints is possible. However, we choose to parameterize the functional model so that an additional constraint is unnecessary and the equations become simpler. Therefore, we choose to fix one coordinate of the point on the line
z 0 = i = 1 n z i n = z ¯ ,
as well as one of the unknown components of the direction vector
c = 1 .
This simplification of the functional model has been used by Borovička et al. [25] for a similar practical example, this of estimating the trajectory of a meteor. As already mentioned in that work, the resulting direction vector of the straight line can be transformed to a unit vector afterwards, i.e., a solution using the constraint a 2 + b 2 + c 2 = 1 . The simplified functional model can be written in vector notation as
( y c + v y e y 0 ) a ( z c + v z e z ¯ ) = 0 , ( x c + v x e x 0 ) b ( z c + v z e z ¯ ) = 0 ,
with the vectors x c , y c and z c containing the coordinates of the observed points and vectors v x , v y and v z the respective residuals. Vector e is a vector of ones, with length equal to the number of observed points n.
A weighted least squares solution of this problem can be derived by minimizing the objective function
Ω = v x T P xx v x + v y T P yy v y + v z T P zz v z + 2 v x T P xy v y + 2 v x T P xz v z + 2 v y T P yz v z
or by searching for stationary points of the Lagrange function
K = Ω 2 k 1 T ( y c + v y e y 0 ) a ( z c + v z e z ¯ ) 2 k 2 T ( x c + v x e x 0 ) b ( z c + v z e z ¯ )
with two distinct vectors k 1 and k 2 of Lagrange multipliers. Taking the partial derivatives with respect to all unknowns and setting them to zero results in the system of normal equations
1 2 K v x T = P xx v x + P xy v y + P xz v z k 2 = 0 ,
1 2 K v y T = P yy v y + P yx v x + P yz v z k 1 = 0 ,
1 2 K v z T = P yy v y + P xz v x + P yz v y + a k 1 + b k 2 = 0 ,
1 2 K k 1 T = ( y c + v y e y 0 ) a ( z c + v z e z ¯ ) = 0 ,
1 2 K k 2 T = ( x c + v x e x 0 ) a ( z c + v z e z ¯ ) = 0 ,
1 2 K a = k 1 T z c + v z e z ¯ = 0 ,
1 2 K b = k 2 T z c + v z e z ¯ = 0 ,
1 2 K y 0 = e T k 1 = 0 ,
1 2 K x 0 = e T k 2 = 0 .
To derive explicit expressions for the residual vectors, we write Equations (35)–(37) as
P xx P xy P xz P yx P yy P yz P zx P zy P zz v x v y v z = k 2 k 1 a k 1 b k 2 ,
which leads to the solution for the residual vectors
v x v y v z = P xx P xy P xz P yx P yy P yz P zx P zy P zz 1 k 2 k 1 a k 1 b k 2 = Q xx Q xy Q xz Q yx Q yy Q yz Q zx Q zy Q zz k 2 k 1 a k 1 b k 2 ,
or explicitly
v x = Q xy a Q xz k 1 + Q xx b Q xz k 2 ,
v y = Q yy a Q yz k 1 + Q xy b Q yz k 2 ,
v z = Q yz a Q z k 1 + Q xz b Q zz k 2 .
Inserting these expressions for the residual vectors into Equations (38) and (39) yields
W 1 k 1 + W 2 k 2 + y c e y 0 a z c = 0 ,
W 2 k 1 + W 3 k 2 + x c e x 0 b z c = 0 ,
with the auxiliary matrices W 1 , W 2 and W 3 as
W 1 = Q y 2 a Q yz + a 2 Q z ,
W 2 = Q xy a Q xz b Q yz + a b Q z ,
W 3 = Q x 2 b Q xz + b 2 Q z ,
Using Equations (49), (50) and (40)–(43), the nonlinear equation system
W 1 k 1 + W 2 k 2 e y 0 a z c = y c , W 2 k 1 + W 3 k 2 e x 0 b z c = x c , z c + v z e z ¯ T k 1 = 0 , z c + v z e z ¯ T k 2 = 0 , e T k 1 = 0 , e T k 2 = 0
can be set up. To express this system of equations into a block matrix form and to obtain a symmetrical matrix of normal equations in the following, it is advantageous to add the terms a v z e z ¯ and b v z e z ¯ to both sides of the first two equations, leading to the system of equations
W 1 k 1 + W 2 k 2 e y 0 a z c + v z e z ¯ = y c a v z e z ¯ , W 2 k 1 + W 3 k 2 e x 0 b z c + v z e z ¯ = x c b v z e z ¯ , z c + v z e z ¯ T k 1 = 0 , z c + v z e z ¯ T k 2 = 0 , e T k 1 = 0 , e T k 2 = 0 .
Arranging the unknowns in a vector
X = k 1 k 2 a b y 0 x 0 ,
the equation system (55) can be written as
N X = n .
with the matrix of normal equations
N = W A A T 0 ,
constructed using the matrices
W = W 1 W 2 W 2 W 3
and
A T = z c + v z e z ¯ 0 0 z c + v z e z ¯ e 0 0 e .
The right-hand side of the equation system (57) reads
n = y c a z c + v z e z ¯ x c b z c + v z e z ¯ 0 0 0 0
It is important to point out that matrix N and vector n contain the unknown parameters a, b and v z in their entries. Therefore, to express and solve these normal equations that live in the “nonlinear world” with the help of vectors and matrices (that only exist in the “linear world”), appropriate approximate values a 0 , b 0 and v z 0 have to be introduced for all auxiliary matrices required for the setup of matrix N and vector n . The solution for the vector of unknowns can be computed by
X ^ = N 1 n ,
without the need of a linearization by Taylor series at any step of the calculation process. The WTLS solution for the line parameters can be computed following the ordinary iteration method, as it is explained for example by Bronhstein ([24], p. 896). Therefore, the solutions a ^ , b ^ and v ˜ z , after stripping them of their random character, are to be substituted as new approximate values as long as necessary until a sensibly chosen break-off condition is met. For example, the maximum absolute difference between two consecutive solutions must be smaller than a predefined threshold ϵ , which in this problem can be formulated as
max a 0 b 0 a ^ b ^ ϵ ,
with · denoting the absolute value. The predicted residual vectors v ˜ x , v ˜ y , v ˜ z can be computed from Equations (46)–(48). The iterative procedure for the presented WTLS solution can be found in Algorithm 1.
Algorithm 1 Iterative WTLS solution
  • Choose approximate values for a 0 , b 0 and v z 0 .
  • Define parameter c = 1 .
  • Set threshold ϵ for the break-off condition of the iteration process.
  • Set parameter d a = d b = , for entering the iteration process.
  • while d a > ϵ and d b > ϵ do
  •     Compute matrices W and A .
  •     Build matrix N and vector n .
  •     Estimate the vector of unknowns X ^ .
  •     Compute the residual vector v ˜ z .
  •     Compute parameters d a = | a ^ a 0 | and d b = | b ^ b 0 | .
  •     Update the approximate values with the estimated ones, with a 0 = a ^ , b 0 = b ^ and v z 0 = v ˜ z .
  • end while
  • return a ^ and b ^ , with c = 1 .
After computing the line parameters a ^ and b ^ and putting them into a vector, we can easily scale it into a unit vector by dividing each component with the length of the vector
a n b n c n = a ^ b ^ 1 a ^ b ^ 1
with · denoting the Euclidean norm. The derived parameters a n , b n and c n refer to the normalized components of a unit vector, that is parallel to the requested line, with
a n 2 + b n 2 + c n 2 = 1

2.4. WTLS Solution with Singular Dispersion Matrices

The algorithmic approach presented in Section 2.3 can also cover cases when dispersion matrices are singular. Such a solution depends on the inversion of matrix N (58), which depends on the rank deficiency of matrix W (59). Following the argumentation of Malissiovas ([20], p. 112), a criterion that ensures a unique solution of the problem can be described in this case by
rank W | A = 2 n ,
with
-
rank of W 2 n , with 2 n = number of condition equations, since for each of the observed n points two condition equations from Equation (2) are taken into account;
-
rank of A = m , with m = number of unknown parameters.
In cases of singular dispersion matrices, the rank of matrix W will be smaller than 2 n . A unique solution will exist if the rank of the augmented matrix W | A is equal to the number of condition equations 2 n of the problem. It is important to mention that the developed idea is based on the Neitzel–Schaffrin criterion, which has been firstly proposed by Neitzel and Schaffrin [26,27], particularly for a solution of an adjustment problem within the GH model when singular dispersion matrices must be employed.

2.5. A Posteriori Error Estimation

In this section we want to determine the variance-covariance matrix of the estimated parameters. The following derivations can be used for computing the a posteriori stochastic information for all weighted cases discussed in this investigation, i.e., the direct and the iterative WTLS solutions. Therefore, we will employ the fundamental idea of variance-covariance propagation. This is a standard procedure explained by many authors, like for example in the textbooks of Wells and Krakiwsky ([28], p. 20), Mikhail ([29], p. 76 ff.) or Niemeier ([8], p. 51 ff.) and has been further employed in the GM and the GH model, so that the a posteriori stochastic results can be computed using directly the developed matrices from each model. A detailed explanation is given by Malissiovas ([20], p. 31 ff.).
As we have already mentioned in the introduction of this article, a TLS, respectively a WTLS solution, can be regarded as a special case of a least squares solution within the GH model. From the presented WTLS algorithm we observe that the derived matrix of normal Equation (58) is equal to the matrix if it was computed within the GH model. Therefore, it is possible to compute
N 1 = Q 11 Q 12 Q 21 Q 22
and extract the dispersion matrix for the unknown parameters from
Q x ^ x ^ = Q 22 .
The a posteriori variance factor is
σ ^ 0 2 = v T P v r
with vector v holding all residuals and r denoting the redundancy of the adjustment problem. In case of a singular dispersion matrix, it is not possible to compute the weight matrix P , as in Equation (27). Therefore, we can make use of the solution for the residual vectors from Equation (45) and insert them in Equation (69) to obtain
σ ^ 0 2 = v x T k 2 + v y T k 1 a v z T k 1 b v z T k 2 r .
The variance-covariance matrix of the unknown parameters can be then derived by
Σ x ^ x ^ = σ ^ 0 2 Q x ^ x ^ = σ a 2 σ a b σ a y 0 σ a x 0 σ b a σ b 2 σ b y 0 σ b x 0 σ y 0 a σ y 0 b σ y 0 2 σ y 0 x 0 σ x 0 a σ x 0 b σ x 0 y 0 σ x 0 2 .
To derive the variance-covariance matrix of the normalized vector components (64), we can explicitly write the equations
a n = a ^ a ^ 2 + b ^ 2 + c 2 , b n = b ^ a ^ 2 + b ^ 2 + c 2 , c n = c a ^ 2 + b ^ 2 + c 2 .
with c = 1 . Following the standard procedure of the variance-covariance propagation in nonlinear cases, we can write the Jacobian matrix
F = a n a a n b b n a b n b c n a c n b .
Taking into account the variances and covariances of the line parameters a ^ and b ^ from (71)
Σ a ^ b ^ = Σ x ^ x ^ ( 1 : 2 , 1 : 2 ) = σ a 2 σ a b σ b a σ b 2 ,
we can compute the variance-covariance matrix of the normalized components
Σ a n b n c n = F Σ a ^ b ^ F T = σ a n 2 σ a n b n σ a n c n σ b n a n σ b n 2 σ b n c n σ c n a n σ c n b n σ c n 2 .

3. Numerical Examples

In this section we present the solutions for fitting a straight line to 3D point data using the TLS approach from Section 2.1 and the newly developed WTLS approaches from Section 2.2 and Section 2.3. The utilized dataset for this investigaiton consists of n = 50 points and originates from the work of Petras and Podlubny [30]. It has been utilized also by Snow and Schaffrin, see Table A1 in [6], for a solution within the GH model, which will be used here for validating the results of the presented WTLS solutions. Three different stochastic models will be imposed in the following:
  • equal weights, i.e., coordinate components x i , y i , z i as equally weighted and uncorrelated observations,
  • pointwise weights, i.e., coordinate components with same precision for each point and without correlations,
  • general weights, i.e., correlated coordinate components of individual precision including singular dispersion matrices.

3.1. Equal Weights

For the first case under investigation, we consider all coordinate components x i , y i , z i as equally weighted and uncorrelated observations, yielding the weights as shown in (3). The least squares solution of this problem within the GH model, presented by Snow and Schaffrin [6], is listed in Table 1.
A direct TLS solution for this problem can be derived using the approach presented in Section 2.1. The results are shown in Table 2. Numerically equal results have been derived by using the direct WTLS approach of Section 2.2 by setting all weights equal to one.
Comparing the solution with the one presented in Table 1, it can be concluded that the numerical results for the parameters coincide within the specified decimal places. Regarding the small difference in the numerical value for the variance factor, it is to be noted that the value in Table 2 was confirmed by two independent computations.
Furthermore, a point on the line can be easily computed using the equations of the functional model (2), as long as the direction vector parallel to the requested line is known. Alternatively, all the adjusted points will lie on the requested straight line, which can be simply computed by adding the computed residuals to the measured coordinates.

3.2. Pointwise Weights

For the second weighted case under investigation, we consider the coordinate components x i , y i , z i of each point P i to be uncorrelated and of equal precision. From the standard deviations listed in Table 3, the corresponding pointwise weights can be obtained from (11).
A direct WTLS solution is derived, following the approach presented in Section 2.2. The determinant (23)
( d 1 k ) d 4 d 5 d 4 ( d 2 k ) d 6 d 5 d 6 ( d 3 k ) = 0 ,
can be built with the components
d 1 = 213.505250528675 , d 2 = 206.458905097029 , d 3 = 198.273122927545 , and d 4 = 20.9837621443375 , d 5 = 12.1835697465792 , d 6 = 81.6787394185243 .
which leads to the solutions for the Lagrange multiplier
k ^ = 115.0596477492 ( k ^ min ) 218.3490470615 284.8285837425
The direct WTLS solution for the line orientation components is shown in Table 4.
The presented results are numerically equal to the iterative WTLS solution using the algorithmic approach of Section 2.3, as well as the solution within the GH model.

3.3. General Weights

For the last weighted case in this investigation, we impose the most general case, i.e., correlated coordinate components with individual precision resulting in a singular dispersion matrix. To obtain such a matrix for our numerical investigations, we firstly solved the adjustment problem within the GH model with an identity matrix as dispersion matrix. From the resulting 150 × 150 dispersion matrix of the residuals
Q vv = Q v x v x Q v x v y Q v x v z Q v y v x Q v y v y Q v y v z Q v z v x Q v z v y Q v z v z ,
computed as e.g., presented by Malissiovas ([20], p. 46), we take the variances and covariances between the individual point coordinates, but not among the points, i.e., the diagonal elements of each sub-matrix in (78) and arrange them in a new 150 × 150 matrix
Q LL = diag Q v x v x diag Q v x v y diag Q v x v z diag Q v y v x diag Q v y v y diag Q v y v z diag Q v z v x diag Q v z v y diag Q v z v z ,
with “ diag ( ) ” denoting that only the diagonal elements are taken into account. This is an example of pointwise variances and covariances, described as case (i) in Section 2.3, but now yielding a singular dispersion matrix for the observations with
rank Q LL = 100 .
Before deriving an iterative WTLS solution for this weighted case, we must check if the criterion (66) for a unique solution of the adjustment problem is fulfilled. Therefore, we computed the 100 × 100 matrix W with
rank W = 100 ,
and the 100 × 4 matrix A with
rank A = 4 .
The criterion ensures that a unique solution exists when using the presented singular dispersion matrix, while
rank W | A = 100 ,
since n = 50 observed points are used in this example, cf. (66). As for all iterative procedures, appropriate starting values for the unknowns must be provided. However, they can be obtained easily by first generating a direct solution with a simplified stochastic model. The iterative WTLS solution for the direction vector of the requested straight line is presented in Table 5.
The presented WTLS solution has been found to be numerically equal to the least squares solution within the GH model. Detailed numerical investigations of the convergence behaviour, e.g., in comparison to an adjustment within the GH model, are beyond the scope of this article. However, in many numerical examples it could be observed that the iterative WTLS approach showed a faster convergence rate compared to an adjustment within an iteratively linearized GH model.

4. Conclusions

For the problem of straight line fitting to 3D point data, two novel WTLS algorithms for two individual weighting schemes have been presented in this study:
-
Direct WTLS solution for the case of pointwise weights, i.e., coordinate components with same precision for each point and without correlations,
-
Iterative WTLS solution for the case of general weights, i.e., correlated coordinate components of individual precision including singular dispersion matrices. This algorithm works without linearizing the problem by Taylor series at any step of the solution process.
Both approaches are based on the work of Malissiovas [20], where similar algorithms have been presented for adjustment problems that belong to the same class, i.e., nonlinear adjustments that can be expressed within the EIV model. The approach presented in Section 2.1 provides a direct TLS solution assuming equally weighted and uncorrelated coordinate components. The fact that this assumption is inappropriate, e.g., for the evaluation of laser scanning data, has often been accepted in the past to provide a direct solution for large data sets. With the newly developed approach in Section 2.2 it is now possible to compute a direct WTLS solution at least for a more realistic stochastic model, namely pointwise weighting schemes.
If more general weight matrices must be taken into account in the stochastic model, including correlations or singular dispersion matrices, the presented algorithm of Section 2.3 can be utilized for an iterative solution without linearizing the problem by Taylor series at any step, following the algorithmic idea of WTLS. A criterion that ensures a unique solution of the problem when employing singular dispersion matrices has also been presented, which is based on the original ideas of Neitzel and Schaffrin [26,27], for a solution within the GH model.
Numerical examples have been presented in Section 3 for testing the presented WTLS algorithms. The utilized dataset of the observed 3D point data has also been employed by Snow and Schaffrin [6] for a solution of the problem within the GH model and originates from the study of Petras and Podlubny [30]. The results of the presented algorithms have been compared in all cases with existing solutions or the solutions coming from existing algorithms and have been found to be numerically equal.

Author Contributions

Conceptualization, G.M., F.N. and S.P.; methodology, G.M. and S.P.; software, G.M. and S.W.; validation, F.N. and S.P.; formal analysis, G.M.; investigation, G.M. and S.W.; data curation, G.M. and S.W.; writing—original draft preparation, G.M. and F.N.; writing—review and editing, G.M., F.N., S.P. and S.W.; supervision, F.N. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

The authors acknowledge support by the German Research Foundation and the Open Access Publication Fund of TU Berlin.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jovičić, D.; Lapaine, M.; Petrović, S. Prilagođavanje pravca skupu točaka prostora [Fitting a straight line to a set of points in space]. Geod. List. 1982, 36, 260–266. (In Croatian) [Google Scholar]
  2. Kahn, P.C. Simple methods for computing the least squares line in three dimensions. Comput. Chem. 1989, 13, 191–195. [Google Scholar] [CrossRef]
  3. Drixler, E. Analyse der Form und Lage von Objekten im Raum [Analysis of the Form and Position of Objects in Space]; Deutsche Geodätische Kommission bei der Bayerischen Akademie der Wissenschaften (DGK): München, Germany, 1993; Volume C, No. 409. (In German) [Google Scholar]
  4. Späth, H. Zur numerischen Berechnung der Trägheitsgeraden und der Trägheitsebene [Numerical calculation of the straight line of inertia and the plane of inertia]. avn Allg. Vermess. Nachr. 2004, 111, 273–275. (In German) [Google Scholar]
  5. Kupferer, S. Verschiedene Ansätze zur Schätzung einer ausgleichenden Raumgeraden [Different approaches for estimating an adjusted spatial line]. avn Allg. Vermess.-Nachr. 2004, 111, 162–170. (In German) [Google Scholar]
  6. Snow, K.; Schaffrin, B. Line Fitting in Euclidian 3D-Space. Stud. Geophys. Geod. 2016, 60, 210–227. [Google Scholar] [CrossRef]
  7. Ghilani, C. Adjustment Computations, Spatial Data Analysis, 6th ed.; John Wiley and Sons, Inc.: Hoboken, NJ, USA, 2018. [Google Scholar]
  8. Niemeier, W. Ausgleichungsrechnung [Adjustment Computations], 2nd ed.; Walter de Gruyter: New York, NY, USA, 2008. (In German) [Google Scholar]
  9. Perović, G. Least Squares (Monograph); Faculty of Civil Engineering, University of Belgrade: Belgrade, Serbia, 2005. [Google Scholar]
  10. Pope, A. Some pitfalls to be avoided in the iterative adjustment of nonlinear problems. In Proceedings of the 38th Annual Meeting of the American Society of Photogrammetry, Washington, DC, USA, 12–17 March 1972; pp. 449–477. [Google Scholar]
  11. Lenzmann, L.; Lenzmann, E. Strenge Auswertung des nichtlinearen Gauss-Helmert-Modells [Rigorous solution of the nonlinear Gauss-Helmert-Model]. avn Allg. Vermess. Nachr. 2004, 111, 68–73. (In German) [Google Scholar]
  12. Golub, G.; Van Loan, C. An analysis of the total least squares problem. SIAM 1980, 17, 883–893. [Google Scholar] [CrossRef]
  13. Van Huffel, S.; Vandewalle, J. Algebraic Connections Between the Least Squares and Total Least Squares Problems. Numer. Math. 1989, 55, 431–449. [Google Scholar] [CrossRef]
  14. Van Huffel, S.; Vandewalle, J. The Total Least Squares Problem: Computational Aspects and Analysis; SIAM: Philadelphia, PA, USA, 1991. [Google Scholar]
  15. Malissiovas, G.; Neitzel, F.; Petrovic, S. Götterdämmerung over total least squares. J. Geod. Sci. 2016, 6, 43–60. [Google Scholar] [CrossRef] [Green Version]
  16. Schaffrin, B.; Wieser, A. On weighted total least-squares adjustment for linear regression. J. Geod. 2008, 82, 415–421. [Google Scholar] [CrossRef]
  17. Shen, Y.; Li, B.; Chen, Y. An iterative solution of weighted total least-squares adjustment. J. Geod. 2011, 85, 229–238. [Google Scholar] [CrossRef]
  18. Amiri-Simkooei, A.; Jazaeri, S. Weighted total least squares formulated by standard least squares theory. J. Geod. Sci. 2012, 2, 113–124. [Google Scholar] [CrossRef]
  19. Snow, K. Topics in Total Least-Squares within the Errors-In-Variables Model: Singular Cofactor Matrices and Prior Information. Ph.D. Thesis, Division of Geodetic Science, School of Earth Sciences, The Ohio State University, Columbus, OH, USA, 2012. Report. No. 502. [Google Scholar]
  20. Malissiovas, G. New Nonlinear Adjustment Approaches for Applications in Geodesy and Related Fields; Ausschuss Geodäsie der Bayerischen Akademie der Wissenschaften (DGK): München, Germany, 2019; Volume C, No. 841. [Google Scholar]
  21. Guo, C.; Peng, J.; Li, C. Total least squares algorithms for fitting 3D straight lines. Int. J. Appl. Math. Mach. Learn. 2017, 6, 35–44. [Google Scholar] [CrossRef]
  22. Neitzel, F.; Petrovic, S. Total Least Squares (TLS) im Kontext der Ausgleichung nach kleinsten Quadraten am Beispiel der ausgleichenden Geraden [Total Least Squares in the context of least squares adjustment of a straight line]. zfv Z. für Geodäsie, Geoinf. und Landmanagement 2008, 133, 141–148. (In German) [Google Scholar]
  23. Neitzel, F. Generalisation of Total Least-Squares on example of unweighted and weighted similarity transformation. J. Geod. 2010, 84, 751–762. [Google Scholar] [CrossRef]
  24. Bronshtein, I.; Semendyayev, K.; Musiol, G.; Muehlig, H. Handbook of Mathematics, 5th ed.; Springer: Berlin/Heidelberg, Germnay; New York, NY, USA, 2007. [Google Scholar]
  25. Borovička, J.; Spurný, P.; Keclíková, J. A new positional astrometric method for all-sky cameras. Astron. Astrophys. Suppl. Ser. 1995, 112, 173–178. [Google Scholar]
  26. Neitzel, F.; Schaffrin, B. On the Gauss-Helmert model with a singular dispersion matrix where BQ is of smaller rank than B. J. Comput. Appl. Math. 2016, 291, 458–467. [Google Scholar] [CrossRef]
  27. Neitzel, F.; Schaffrin, B. Adjusting a 2D Helmert transformation within a Gauss-Helmert model with a singular dispersion matrix where BQ is of smaller rank than B. Acta Geod. Geophys. Montan. Hung. 2017, 52, 479–496. [Google Scholar] [CrossRef] [Green Version]
  28. Wells, D.; Krakiwsky, E.J. The Method of Least Squares; Lecture Notes 18; Department of Geodesy and Geomatics Engineering, University of New Brunswick: Fredericton, NB, Canada, 1971. [Google Scholar]
  29. Mikhail, E.M. Observations and Least Squares; Harper & Row Publishers: New York, NY, USA; Hagerstown, MD, USA; San Francisco, CA, USA; London, UK, 1976. [Google Scholar]
  30. Petras, I.; Podlubny, I. State space description of national economies: The V4 countries. Comput. Stat. Data Anal. 2007, 52, 1223–1233. [Google Scholar] [CrossRef] [Green Version]
Table 1. Least squares solution within the Gauss–Helmert (GH) model of Snow and Schaffrin [6].
Table 1. Least squares solution within the Gauss–Helmert (GH) model of Snow and Schaffrin [6].
Line Orientation Components Standard Deviation
Parameter b ^ y = a n 0.219309 0.077523
Parameter b ^ x = b n 0.677404 0.058450
Parameter b ^ z = c n 0.702159 0.056575
Coordinates of a point on the line Standard deviation
Parameter a ^ y = y 0 0.047785 0.121017
Parameter a ^ x = x 0 −0.067111 0.091456
Parameter a ^ z = z 0 0.049820 0.088503
A posteriori variance factor σ ^ 0 2 0.7642885
Table 2. Direct TLS solution from Section 2.1.
Table 2. Direct TLS solution from Section 2.1.
Line Orientation Components Standard Deviation
Parameter a n 0.219308632730 0.07752314583
Parameter b n 0.677404488809 0.05844978733
Parameter c n 0.702158730025 0.05657536189
A posteriori variance factor σ ^ 0 2 0.76428828602
Table 3. Pointwise precision σ x i = σ y i = σ z i = σ i for each point P i .
Table 3. Pointwise precision σ x i = σ y i = σ z i = σ i for each point P i .
Point i σ i Point i σ i
10.802 260.792
20.795 270.799
30.807 280.801
40.770 290.807
50.808 300.798
60.799 310.796
70.794 320.792
80.808 330.806
90.807 340.805
100.800 350.801
110.789 360.808
120.798 370.778
130.808 380.795
140.803 390.794
150.804 400.803
160.808 410.772
170.806 420.791
180.806 430.806
190.807 440.804
200.806 450.807
210.804 460.803
220.808 470.808
230.805 480.801
240.801 490.805
250.801 500.779
Table 4. Direct WTLS solution from Section 2.2.
Table 4. Direct WTLS solution from Section 2.2.
Line Orientation Components Standard Deviation
Parameter a n 0.230818543507 0.07646636344
Parameter b n 0.677278360907 0.05781967335
Parameter c n 0.698582007942 0.05623243170
A posteriori variance factor σ ^ 0 2 1.19853799739
Table 5. Iterative WTLS solution from Section 2.3.
Table 5. Iterative WTLS solution from Section 2.3.
Line Orientation Components Standard Deviation
Parameter a n 0.225471114499 0.076563026291
Parameter b n 0.677670055415 0.057791104518
Parameter c n 0.699947192665 0.056127005073
A posteriori variance factor σ ^ 0 2 0.798915322513

Share and Cite

MDPI and ACS Style

Malissiovas, G.; Neitzel, F.; Weisbrich, S.; Petrovic, S. Weighted Total Least Squares (WTLS) Solutions for Straight Line Fitting to 3D Point Data. Mathematics 2020, 8, 1450. https://doi.org/10.3390/math8091450

AMA Style

Malissiovas G, Neitzel F, Weisbrich S, Petrovic S. Weighted Total Least Squares (WTLS) Solutions for Straight Line Fitting to 3D Point Data. Mathematics. 2020; 8(9):1450. https://doi.org/10.3390/math8091450

Chicago/Turabian Style

Malissiovas, Georgios, Frank Neitzel, Sven Weisbrich, and Svetozar Petrovic. 2020. "Weighted Total Least Squares (WTLS) Solutions for Straight Line Fitting to 3D Point Data" Mathematics 8, no. 9: 1450. https://doi.org/10.3390/math8091450

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop