+ All Categories
Home > Documents > Analysis of measurements based on the singular value decomposition

Analysis of measurements based on the singular value decomposition

Date post: 30-Oct-2014
Category:
Upload: stillife
View: 428 times
Download: 4 times
Share this document with a friend
Description:
Using Singular Value Decomposition (SVD) to analyze field measurements in healthcare and medical physics.
11
SIAM J. ScI. STAT. COMPUT. Vol. 2, No. 3, September 1981 1981 Society for Industrial and Applied Mathematics 0196-5204/81/0203-0009 $01.00/0 ANALYSIS OF MEASUREMENTS BASED ON THE SINGULAR VALUE DECOMPOSITION* RICHARD J. HANSON AND MICHAEL J. NORRIS$ Abstract. The problem of maintaining quality control of manufactured parts is considered. This involves matching points on the parts with corresponding points on a drawing. The difficulty in this process is that the measurements are often in different coordinate systems. Using the assumption that the relation between the two sets of coordinates is a certain rigid transformation, an explicit least squares solution is obtained. This solution requires the singular value decomposition of a related matrix. Other topics in the paper include an appropriate angular representation of the resulting orthogonal transformation matrix, and a computational algorithm for the various required quantities. Key words, orthogonal matrices, singular value decomposition, orthogonal Procrustes problem, analysis of measurements, quality control, part matching, least squares 1. Introduction. The following problem arises in the analysis of measurements made on manufactured parts for the purpose of quality control. A part is to be machined in accordance with specifications on drawings. To check conformance of this part with the drawings, a set of distinguished points is taken from the drawings and a corresponding set of points is taken from the part. If discrepancies between the two sets of coordinates are all within tolerance, the part is acceptable. Otherwise the part is deemed unacceptable and is discarded. Discrepancies between the two sets of corresponding points can come from inaccuracies in manufacturing the part, or inaccuracy in measurements with respect to coordinate systems for the part or the drawing. Furthermore, it may be necessary to measure the set of points on the part in a different coordinate system than the points on the drawing. This introduces (possibly) large discrepancies between the points on the part and the points on the drawing. We will not discuss in detail the problem of where or how the distinguished set of measurements should be taken on both the drawing and the part. This is a difficult matter that involves judgment from the individual responsible for quality control of the manufacturing process. To salvage acceptable parts, one must account for the different coordinate system, in the two sets of measurements. It seems plausible that (to within error whose effect is negligible relative to tolerances) the coordinate axes of the set of drawings are orthogonal. Also, errors in any measurements made on the drawings are similarly negligible. One also expects that the measuring device, to within acceptable errors, yields measurements relative to a set of orthogonal coordinate axes. However, in addition to any intended change of coordinate system, the part undergoing the test may be improperly positioned relative to the coordinate system of the measuring device. This could result from some designated point on the part not being set at its prescribed location or from the entire part being misoriented relative to the coordinate axes. To accommodate these possibilities the relationship between the coordinate * Received by the editors August 18, 1980. This work was sponsored by the U.S. Department of Energy under contract DE-AC04-76DP00789. " Numerical Mathematics Division, Sandia National Laboratories, Albuquerque, New Mexico 87185 (a U.S. Department of Energy facility). Applied Mathematics Department, Sandia National Laboratories, Albuquerque, New Mexico 87185 (a U.S. Department of Energy facility). 363 Downloaded 06/24/12 to 128.189.115.94. Redistribution subject to SIAM license or copyright; see http://www.siam.org/journals/ojsa.php
Transcript
Page 1: Analysis of measurements based on the singular value decomposition

SIAM J. ScI. STAT. COMPUT.Vol. 2, No. 3, September 1981

1981 Society for Industrial and Applied Mathematics

0196-5204/81/0203-0009 $01.00/0

ANALYSIS OF MEASUREMENTS BASED ON THESINGULAR VALUE DECOMPOSITION*

RICHARD J. HANSON AND MICHAEL J. NORRIS$

Abstract. The problem of maintaining quality control of manufactured parts is considered. This involvesmatching points on the parts with corresponding points on a drawing. The difficulty in this process is thatthe measurements are often in different coordinate systems. Using the assumption that the relation betweenthe two sets of coordinates is a certain rigid transformation, an explicit least squares solution is obtained.This solution requires the singular value decomposition of a related matrix.

Other topics in the paper include an appropriate angular representation of the resulting orthogonaltransformation matrix, and a computational algorithm for the various required quantities.

Key words, orthogonal matrices, singular value decomposition, orthogonal Procrustes problem, analysisof measurements, quality control, part matching, least squares

1. Introduction. The following problem arises in the analysis of measurementsmade on manufactured parts for the purpose of quality control.

A part is to be machined in accordance with specifications on drawings. To checkconformance of this part with the drawings, a set of distinguished points is taken fromthe drawings and a corresponding set of points is taken from the part. If discrepanciesbetween the two sets of coordinates are all within tolerance, the part is acceptable.Otherwise the part is deemed unacceptable and is discarded.

Discrepancies between the two sets of corresponding points can come frominaccuracies in manufacturing the part, or inaccuracy in measurements with respectto coordinate systems for the part or the drawing. Furthermore, it may be necessaryto measure the set of points on the part in a different coordinate system than thepoints on the drawing. This introduces (possibly) large discrepancies between thepoints on the part and the points on the drawing.

We will not discuss in detail the problem of where or how the distinguished setof measurements should be taken on both the drawing and the part. This is a difficultmatter that involves judgment from the individual responsible for quality control ofthe manufacturing process.

To salvage acceptable parts, one must account for the different coordinate system,in the two sets of measurements. It seems plausible that (to within error whose effectis negligible relative to tolerances) the coordinate axes of the set of drawings areorthogonal. Also, errors in any measurements made on the drawings are similarlynegligible. One also expects that the measuring device, to within acceptable errors,yields measurements relative to a set of orthogonal coordinate axes. However, inaddition to any intended change of coordinate system, the part undergoing the testmay be improperly positioned relative to the coordinate system of the measuringdevice. This could result from some designated point on the part not being set at itsprescribed location or from the entire part being misoriented relative to the coordinateaxes. To accommodate these possibilities the relationship between the coordinate

* Received by the editors August 18, 1980. This work was sponsored by the U.S. Department ofEnergy under contract DE-AC04-76DP00789.

" Numerical Mathematics Division, Sandia National Laboratories, Albuquerque, New Mexico 87185(a U.S. Department of Energy facility).

Applied Mathematics Department, Sandia National Laboratories, Albuquerque, New Mexico 87185(a U.S. Department of Energy facility).

363

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 2: Analysis of measurements based on the singular value decomposition

364 R. J. HANSON AND M. J. NORRIS

systems should have the general form of a rigid transformation

drawing points orthogonal matrix part points + fixed translation.

(This form of transformation also seems consistent with what one might do to fit twoparts together without forcing. In fact, one could consider one of the parts as the"drawing." Then the transformation can be used to mate the two parts.) It is possibleto minimize this corresponding discrepancy between drawing points and transformsof part points in the least squares sense. One can then base the accept or reject testson the residuals of these equations. Perhaps the most natural choice for an approxima-tion criterion would be to minimize the maximum residual. No direct solution to this"min-max" problem, with the simplicity of the solution for the least squares criterion,is known to the authors.

Using least squares, it is possible to give a simple algorithm for computing the(unknown) orthogonal matrix and the fixed translation of this transformation. Theexpression for this orthogonal matrix involves quantities that derive from the singularvalue decomposition (SVD) [1, pp. 238-239] of a related matrix. This is fullydeveloped in 2.

Section 3 outlines the computations to be performed and 4 discusses thenumerical analysis of the process and describes .a computer program. Section 5 presentsan appropriate angular representation for the transformation matrix. Although theoriginal problem was in two or three space dimensions (and it is difficult to contemplatethe problem in higher dimensions) the treatment in 2 and 3 is applicable to anyfinite-dimensional space.

2. Analysis. In the following development the vectors are real, n-dimensional,and are also considered as n 1 matrices. For our derivation of the optimal transforma-tion, we use the functional

(M, N) -= trace (MTN).

For M N, this dot (or inner) product defines the Frobenius or Euclidean norm inthe linear vector space of rh x , real matrices. (Here MT transpose of M, and trace(MTN) sum of the diagonal terms of MTN.)

The dot. product has a number of easily proved properties stated as (1)-(5). Thoseproperties allow for various formal interchanges in terms involving dot products ofmatrices. These rules are used freely within this section.

()

(2)

(3)

(M, N)= (N, M),

(M,N)=(N:r, MT),(MN, PQ)= (NQ, MTp).

In (3), the indicated products must be defined in order for this to make sense. Also,

(4)

(5)

(M, N +P) (M, N) + (M, P),

(M, aN) a (M, N) (aM, N)

for scalar values of a.

The set of drawing points and the set of part points are respectively denoted by{ Yi 1 _-< _-< K} and {Xi 1 _-< -< K}. Since the coor.dinate systems for the drawing points

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 3: Analysis of measurements based on the singular value decomposition

ANALYSIS OF MEASUREMENTS 365

Y and part points X are related by a rigid transformation we have

(6) Y AX + B.

In (6), the n x n matrix A is orthogonal, ATA I, while B is an n-vector.Other authors have considered problems and used methods that are closely related

to ours. For example, Green [5], Bar-Itzhack [6] an.d especially SchSnemann [7] havesolved the problem of minimizing (A- , AX- Y) where X and I7" are N xK realmatrices and A is an NxN orthogonal matrix. Here we solve the problem ofminimizing (A" +Be7"- I7, A3" +BeT- I7") where ’, I7" and A are as stated above,B is an N-vector, and determinant of A + 1. (The vector e (1, , 1)T.)

The use of the singular value decomposition of square matrices, as utilized inthis paper, simplifies derivations of the formulas for A and the required computations.The methods we present also apply to the above-mentioned related problems whereA is only required to be orthogonal.

To obtain the best fit in the least squares sense, we want to minimize

K

f(A,B)= ., (B-(Yi-AXi),B-(Yi-AXi)).i=1

This expression can be simplified by eliminating B as an unknown. To do this we useLemma 1.

LEMMA 1. If{Rill <-_ <- K} is a set of n-vectors, then & (R ,in= (R Ri, R Ri)is minimized if and only if R =/ (/r= Ri)/K.

This lemma is easily proved by noting that, for all R, (R)=K

.i=1 [(g-,g-)+(Ri-,gi-)].For any specific choice of A, including the optimal value of A which we do not

know yet, Lemma 1 shows that f(A, B) is minimized with

(7) B B Y-AX,

where

and

i=l

Substituting this expression for B B into f(A, B) and defining the two sets of points(each with mean zero)

(8) Xi-- Xi -X, Yi Yi Y, 1,. , Kleads to the expression

K

f(A, B) E (Axi Yi, Axi Yi).i=l

We want to choose an orthogonal n n matrix A (possibly with the additionalrestriction det (A)= 1), to minimize f(A, B). Using (1), (4) and (5),

K

f(A,B)= Y [(Axi, mxi)-2(yi, Axi)+(yi, yi)].i=1

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 4: Analysis of measurements based on the singular value decomposition

366 R. J. HANSON AND M. J. NORRIS

An application of (3)-(5), together with the fact that A is an orthogonal matrix,shows that

K K

f(A,B)=-2 E (yi, Axi)+ , [(xi, xi)+(yi, yi)].i=1 i=1

Finding A to minimize ’(A, B) requires finding an orthogonal matrix that maximizestle related functional

K

g(A)= E (yi, Axi).i=1

KAgain, (3) and (4) show that, with C=; yxr,

(9) g(A) ., (yxf, A)= yx.T,, A =--(C, A).i=1 i=1

It is worthwhile to point out that the inclusion of weights in the definition off(A, B) adds no essential complication or change to the development given here. Infact, if

K

2

then an obvious modification of Lemma 1 shows that

and

B=B= Y-AX,

? E Yii=1

X "/i ’/i.i= i=

Equation (8) is still valid, and minimizing

K

f(A, B) F, y (Axi Yi, Axi yi)i=1

is equivalent to maximizing

g(A) ( 2 )"yiYixTi,A (C, A).i=1

Our point here is that the use of weights merely changes the computation of X,Y and C in a trivial way. The arguments that follow remain unchanged.

To aid in the choice of A that maximizes g(A), we introduce the singular valuedecomposition, SVD, of the n n matrix C,

1 O) C USVT.In (10) the n x n matrices U and V are orthogonal. Further, the n x n diagonal

matrix S-diag (s,..., s.) has the singular values of C as its diagonal terms withSl >- s2 >=. >= s. >= 0. Substituting the SVD of C from (10) into g(A) of. (9) results in

g(A) (USVT, A)= (S, uTA V) (S, W),

where W UTAV {wii} is an n x n orthogonal matrix.

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 5: Analysis of measurements based on the singular value decomposition

ANALYSIS OF MEASUREMENTS 367

We now consider two cases for the optimal choice of A. In the first case A maybe any orthogonal matrix, whereas in the second case A must also have determinantequal to the value 1.

Case I. Determinant ofA has either sign. Since W is an n n orthogonal matrix,each diagonal term satisfies [Wii[ 1, and thus

($, W)= Y sw, N s.i=1 i=1

This inequality becomes an equality if and only if w, 1 for each s > 0. If r isthe number of nonzero singular values, then g(A) ($, W) is maximized precisely when

I

Here Z is an arbitrary (n- r)x (n- r) orthogonal matrix. In case r n the matrix Zis absent, and then W L One is always free to choose W I for all values of r. Thisis effectively the results obtained by Sch6nemann [7].

Case II. Determinant of A +1. The required condition is equivalent todet (W)= det (UrV). If either det (UrV)= 1 or s 0, then the maximum of ($, W)is

__s. An optimal choice of W is the same as in Case I with Z essentially arbitrary

except for the requirement det (Z)- det (UrV). We will need the following lemmafor the remaining development.

LEMMA 2. SUppOSe that W is an n x n real orthogonal matrix with det (W) -1.Then

(a) trace (W) tr(W) _<- n 2;(b) tr(W) n 2 i[ and only i[

W P diag (1,. , 1, -1)Pr

or some n x n orthogonal matrix P.Pro@ Partition the eigenvalues of W into three groups

(i) A , Xt,.. ", A., , (2p complex roots; IAI= 1),(ii) 1,..., 1 (q roots, real and positive),(iii) -1,...,-1 (r roots, real and negative).

Since det (W) IA]2... IA, I2(-1)r= (-1) =-1, we see that r is an odd integer withr->l.

Using Theorem B.9 of [2, p. 285], we note that there is a real .orthogonal matrixP such that pTWp is the direct sum of p individual 2 2 matrices

cos (Oi) sin (0i)-sin (Oi) cos (Oi)]

and the scalar matrices Iq followed by -L. Each angle is a principal argument ofthe complex eigenvalue Z of W, 1-<i<-p. Now computing tr (W)=tr (ppTw)=tr (pTwp) shows that

p

tr (W) 2 E cos (Oi) + q r.i=1

The facts that r >-_ 1, cos (O) <= 1, and 2p + q n r then show that

tr(W)<-n-2r<-n-2.

This completes the proof of part (a) of the conclusion. The "if" clause of part (b) is

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 6: Analysis of measurements based on the singular value decomposition

368 R.J. HANSON AND M. J. NORRIS

obviously true. To prove the "only if" clause of part (b), suppose that tr (W)= n -2.This can occur only if r 1 and

p

2 , cos(Oi)+q=n-1.i=1

The last of these equations says that p 0 and q n 1, so

PT"WP diag-(1, , 1, -1)

and the condition on W follows. This completes the proof of part (b) of the lemma.Suppose then that det(UV)=-I and s,>O. In this case we show that the

maximum of (S, W) is = si-s and that W is essentially the matrixdiag (1,. , 1, -1).

To this end we write the inequalities

n--1 n--1

Si--Sn--(S W)-- Z (1--Wii)Si--(1 -t" Wnn)Sni=1 i=1

_-> Y (1- wii)s. -(1 + w.,,)s,,i=1

[(n 2)- tr (W)]s,,

-_>0.

The first inequality here follows from the elementary fact that no entry of Wexceeds one, and that the nonnegative singular values, {s}, are ordered. The secondinequality uses Lemma 2, part (a).

Suppose now that equality holds throughout these relations. If ] is the smallestindex such that si s,, then equality holds throughout if and only if wii 1 for <and tr (W)= n-2. Thus W maximizes (S, W) if and only if W =diag (/-1, Wn-j/l)where Wn_j/l is orthogonal, det(W,_j/l)=-l, and tr(W,_i/l)=(n-/’+l)-2=n -/’- 1. By Lemma 2, part (b), W maximizes (S, W) if and only if

Pdiag(1,..., 1,-1)Pr

for some orthogonal matrix P.A particular choice of W that always results in the maximum of g(A) for Case

II is

W diag (1,..., 1, det (UrV)).With this particular choice we can evaluate the orthogonal matrix

A UWVr

that maximizes g(A) or, equivalently, minimizes f(A, B).The phenomenon of qll-conditioning" is present in the computation of A in a

subtle form. The dimensions of the arbitrary matrices Z and P of Cases I and II arerelated to the multiplicity of the smallest singular value. If s is the only zero singularvalue then the extra condition det (A)= 1 fixes the previously arbitrary scalarorthogonal matrix Z. Multiple zero singular values may occur when a poor choice ofcoordinate pairs are chosen on the part and drawing. This in turn may lead todiscontinuous dependence of the matrix A on the data in the sense that small changesin the data yield large (but bounded) changes in the elements of A.

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 7: Analysis of measurements based on the singular value decomposition

ANALYSIS OF MEASUREMENTS 369

A similar ty.pe of discontinuity could occur in Case II when sn > 0 is a multiplesingular value. These remarks should be considered with the disclaimer in the Introduc-tion regarding the choice of a distinguished set of points. First, the pair {A, B} mayreduce the size of the residuals and hence be of value even when a large variation inA may result from small variations in the data. Next, it is possible to evaluate thechoice of distinguished points under certain circumstances that we now describe.

Suppose the part is expected to match the drawing rather closely so that Xk isclose to Yk. One can take the matrix G based only on drawing points

KTG ’. YkY k,

k=l

and obtain the singular values (= eigenvalues) of G. Let 8 be the minimum distancebetween two singular values of G. Now C=G+H with H--,kL (Xk--yk)yT. If[[H[I < 8/2 then the singular values of C differ from those of G by less than 8/2 and.also are distinct, [1, p. 25]. Here I[" largest singular value.)

Should the choice of a distinguished set be a poor one on the basis of thesuggested evaluation, it might be possible to change to a completely different distin-guished set or to significantly modify the matrix C by adding points to the distinguishedset. Such possibilities depend of course on the nature of the part and its intended usage.

Frequently a drawing for a part is in a different scale than the part itself. Thismeans that the set of part points {Xi} may be derived from a set of actual measurementson the part {.ei}, by a scale factor, Xi a.,.i, i= 1,..., K.

To provide a check for consistency of these measurements, one can slightly extendthe type of transformation allowed, namely, a rigid transformation combined with achange of scale, or

Y aAX+ B.

Here a >_-0 is a scale factor to be determined, A is orthogonal, and B is an n-vector.The optimal value of a does not affect the optimal choice for A. We will not provethis here, but one chooses A, as outlined above but using the data {} instead of {X}.

The optimal choice for a can be shown to be based on the quantity g(A)-K

(Axi, yi) as follows"

/x(Xi,Xi), 0,

Ol--

0, otherwise.

Now, for example, one can examine the size of both sets of residuals, 1 _-< _-< K,

and

Y-AX-B, B Y-AX,

Yi aAXi B, J -aA..This consistency check on the scaling of measurements can catch the following

type of blunder" A part is manufactured half as large as the drawing scale when itshould have been twice as large as the drawing scale.

Incidentally, it is not necessarily true that the residuals using a will be smallerthan the residuals with c 1. What is true, of course, is that the sums of squares ofresiduals is not larger with the optimal a than with a 1.

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 8: Analysis of measurements based on the singular value decomposition

370 R. J. HANSON AND M. J. NORRIS

Monitoring of the value of a can provide information of potential use for processcontrol. If a is usually significantly above (below) unity, then there is probably a biasin the process. If in addition, the residuals using the optimum value of a are significantlysmaller than those for a 1, then there is possibly a removable source of error in theprocess.

3. Computational steps. The given data are the set {Yi} of drawing points andthe set {Xi} of part points. An algorithm is outlined for determining the orthogonalmatrix A, the n-vector B, and the optimum scale factor, a.

Step

1.

10.

11.

12.

Operation

Compute the means-- (i----1 Yi)/K, -e--(/= Xi)/K.Compute the differences

yi=Yi-Y, xi-Xi-X, i=I,...,K.

Compute the matrix

K

C xiyT.i=1

Compute the SVD of C,

C USVT.Compute the product uTv.Compute the value

cr det (uTv).Compute the orthogonal matrix

A U diag (1,. , 1, tr) Vr.Compute the points Axi and yi, 1,..., K.

Compute the scalar g -,i (Axi, yi).

Compute the optimum scale factor a"

1,0, otherwise.

Compute the translation vector

B Y-AX.

Compute the residuals

ri Yi-Axi, 1,. , K(= Yi AX B).

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 9: Analysis of measurements based on the singular value decomposition

ANALYSIS OF MEASUREMENTS 371

Following Step 12, the components of the residual vector ri are checked for size.If they are all smaller in magnitude than a specified tolerance, the part is accepted.Otherwise the part is rejected.

The optimum scale factor can be used to generate another set of residualsYi-oAi-, where/ I7- ceA’. These components should usually be smal-

ler in magnitude than the specified tolerance for acceptance of the part. The (rare)situation may occur where some r] are larger than the corresponding ri. In the casewhere the ri are within tolerances but the r] are not, it seems that the part should stillbe accepted. Our justification for this statement is that the user of this analysis (mostlikely) has the two sets of points in the same scale, yielding residuals r. Thus somerigid transformation of one set of points to the other has been shown to exist withsufficiently small tolerances. This is, we think, the important point behind this typeof analysis in the first place.

4. Numerical analysis. In 3 the main steps of an algorithm are given that allowsone to compute the orthogonal matrix A, the vector B, and the scalar a of thetransformation Y aAX /B. The computation of A, B and the residuals YI-(AXI / B) are done in the provided subprogram MAP(. for the special cases of n 2or n 3. Each of these steps is straightforward with the exception of Step 4. In thatstep the SVD of an n n matrix C is required. For general values of n, one can usethe Golub-Reinsch algorithm as implemented in subroutine SVDRS(.), [1, p. 250].However, as we noted in the Introduction, this particular problem is most likely tooccur for values of n <_-3. For tis reason a special and succinct version of theGolub-Reinsch algorithm was written for a 3 3 matrix. This subroutine, SVD3B3 (.),is called by MAP(. and implements that algorithm in this special case. By avoidingthe most expensive loops and using plane rotations computed by SROTG (.), [3, p.314], for all the elimination steps, a robust and efficient code was obtained. Theexclusive use of SROTG(.) was made because of the few elimination steps requiredfor a 3 3 matrix. This version of the SVD for 3 3 matrices is at least a factor offive times faster than SVDRS (.) using the CDC 6600 computer. The package ofsubroutines and a sample test program are available directly from the authors. Theprimary subroutine of the package is MAP (.). This subroutine accepts data triples{Xz} and { Yz} as input and returns the matrix A and the vector B, and the residualsRg Yt AXt B as output. There are approximately 796 card images in this package.The program units are all written in highly portable Fortran. We believe that it canbe used on most computers that support Fortran, with no changes required. It isanticipated that the primary interest in this package is with MAP (.). The usageinstructions for this subroutine are as follows.

The user must have the following declaration statement in a program that callsMAP (.):

DIMENSION X(3, K), Y(3, K), R (3, K), A(3, 3), B(3).

Assign values to K, X(*, *), and Y(*, *) and execute the subroutine call

CALL MAP (K, X, Y, R, A, B).

The parameters in the calling sequence fall into two classes" Input and Output.

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 10: Analysis of measurements based on the singular value decomposition

372 R.J. HANSON AND M. J. NORRIS

InputK, X(3, K), Y(3, K) The integer K contains the number of triples of points, {Xx} and

{Yx}. The arrays X(3, K) and Y(3, K) contain the X and Yt,respectively. The first coordinate of Xz is stored in X(1, I); thesecond is stored in X(2, I); the third is stored in X(3, I). Thesame convention holds for Yz. (Note that for n 2 variables,the third coordinate of both the Xx and Yz should be fixed atthe same value, say zero.)

OutputR(3, K)

A(3, 3), B(3)

The residuals Rt Yt-AXz-B are returned in the arrayR (3, K). The coordinates of Rx are stored in the same conven-tion as the coordinates of the Xt and Yz.The optimal orthogonal transformation matrix, A, and transla-tion vector, B, are returned in the arrays A(3, 3) and B(3). Thetransformation has the form Y AX + B. The elements au ofA and the entries bt of B are returned in A(L J) and B(I),respectively.

As an illustration of the process we used MAP (.) to compute A and B from aset of data for both {X} and { Y}.

TABLEAn example, for n 3, computed using MAP (.).

1000 x (R, Yr-AXr-B)

0.99962512 1.0 -0.824561.00049650 1.0 0.287710.99903218 1.0 -0.23266

0.99837196 1.0 0.934300.99947869 1.0 -0.17797

2 -1.00200510 -1.0 0.80444

-1.00184080 -1.0 1.39634-1.00025510 -1.0 0.28408

3 1.00015700 1.0 -0.38086

-0.99843296 -1.0 -1.50609-1.00105830 -1.0 -0.39382

4 -1.00003210 -1.0 -0.19092

--F0.99999990 0.00037760 0.00025253JA" [-0.00037741 0.99999965 -0.00074112

-0.00025281 0.00074102 0.99999969

B: 0.00056948 0.00033381 0.00071211

5. Angular representation of the orthogonal matrix A for n 3. Occasionallyone needs to represent a 3 3 orthogonal matrix as a product of plane rotations orby the angles of these rotations. In a sense, the 3 3 9 pieces of data can berepresented with just three pieces of data. (Often machines are manufactured so thatachieving a rigid coordinate transformation can only be done by rotating about onecoordinate axis, then another, etc.) It seems to the authors that there are compellingreasons to suggest that the use of Euler angles [4, p. 259-270] is the wrong approachfor representing a broad class of orthogonal matrices. Briefly, the Euler angles are

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p

Page 11: Analysis of measurements based on the singular value decomposition

ANALYSIS OF MEASUREMENTS 373

derived from the three plane rotation matrices that diagonalize the orthogonal matrixA, determinant of A 1. The ci cos (0i) and si sin (0), 1, 2, 3. First, Cl and S

are chosen to eliminate the entry at the intersection of row 1 and column 3 of A.This rotation is applied to A to form the matrix product R1A. Next, c2 and s2 arechosen to eliminate row 2, column 3 of R1A. This rotation is applied to RIA to formthe product R2R1A. Finally, c3 and s3 are chosen to eliminate row 1, column 2 ofR2RIA. The product R3R2R1A is the identity matrix by virtue of the fact that theR and A are orthog0nal, and determinant of A 1.

The central problem with this representation for A in our application is that theangles 0 may not depend continuously on the data. This is true because typicallyA- Identity matrix +small terms. These small terms uniquely determine the Oi, butan arbitrarily small change to these terms can make a change in the 0 as much as 2zr.

$3 ilI 0 0 I Cl._.oS S1 il IaalX a12 a131 I1 0 0il3 c3 c2 $2 Cl 21 a22 a23 0 10 --$2 c2 0 la31 a32 a33 0 0

FIG. 1. Deriving Euler angles from an orthogonal matrix.

I 1I2 Jl 01Ia a12 a13/ Ii0il1 0 0 Os2FcISI 11

0 alc3 s3 1 0 -sl cl a22 a231 1

-s3 c3 L.-s2 0 c2 0 0 1 31 a32 a33A 0

FIG. 2. Deriving stable set of angles from an orthogonal matrix.

Our suggestion for a set of angle coordinates for A in our application is basedon triangularizing A as shown in Fig. 2. The first plane rotation is chosen to eliminaterow 2, column 1. This plane rotation is applied to A to form P1A. Next, the secondplane rotation is determined that eliminates row 3, column 1 of P1A. This is appliedto PIA to form P2PIA. Finally, the third plane rotation is applied to eliminate row

DTDTDT3, column 2 of P2PIA. This yields the (continuous) representation A =-1-2-3.The principal angles 0 satisfying ci cos (0i), s sin (0i), 1, 2, 3 are determined

using the two-argument arctangent function. This elementary function is available inmost Fortran systems as ATAN2(., .). One can also use the idea of Stewart [3, p.314] to essentially store just one number for the pair (cg, s), 1, 2, 3. This is equivalentto storing the angles Oi, but it avoids computing the arctangent, sine and cosinefunctions to reconstruct the rotation matrices.

REFERENCES

[1] C. L. LAWSON AND R. J. HANSON, Solving Least Squares Problems, Prentice-Hall, Englewood Cliffs,NJ, 1974.

[2] G. W. STEWART, Introduction to Matrix Computations, Academic Press, New York-London, 1973.[3] C. L. LAWSON, R. J. HANSON, F. T. KROGH AND D. R. KINCAID, Basic linear algebra subprograms

]:or Fortran usage, ACM Trans. Math. Software, 5 (1979), pp. 308-323.[4] I. N. BRONSHTEIN AND K. A. SEMENDYAYEV, A Guide-book to Mathematics ]:or Technologists and

Engineers, Pergamon Press, New York, 1964.[5] B. F. GREEN, The orthogonal approximation of an oblique structure in factor analysis, Psychometrika,

17 (1952), pp. 429-440.[6] I. Y. BAR-ITZHACK, Iterative optimal orthogonalization of the strapdown matrix, IEEE Trans. Aero.

and Electronic Systems, 11 (1975), pp. 30-37.[7] P. H. SCHNEMANN, A generalized solution of the orthogonal Procrustes problem, Psychometrika, 31

(1966), pp. 1-10.

Dow

nloa

ded

06/2

4/12

to 1

28.1

89.1

15.9

4. R

edis

trib

utio

n su

bjec

t to

SIA

M li

cens

e or

cop

yrig

ht; s

ee h

ttp://

ww

w.s

iam

.org

/jour

nals

/ojs

a.ph

p


Recommended