From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: GPA using the procrustes function
Date: Fri, 29 Oct 2010 19:53:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <iaf8mv$t3n$>
References: <ia6550$11n$> <iacbe0$t4h$> <iadnhs$49n$> <iadqfl$7q7$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1288381983 29815 (29 Oct 2010 19:53:03 GMT)
NNTP-Posting-Date: Fri, 29 Oct 2010 19:53:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:682465

"Shyamal L" <> wrote in message <iadqfl$7q7$>...
> ........
> while (G1-G0) > tol
> 		G1 = G0;
> 		for i=2:k;
>             [D, Z] = procrustes(Aligned(:,:,1), Aligned(:,:,i))
> 			Aligned(:,:,i) = Z;
> 		end
> 		G0 = getsumsq(Aligned);
>            numIter=numIter+1;
> end
> ........
- - - - - - - - -
  I do not see the point in your iteration process.  You are aligning each of the matrices Aligned(:,:,i) for i = 2:k with the single matrix Aligned(:,:,1) to the best of 'procrustes' ability - that is, to the matrix that possesses the least square differences with Aligned(:,:,1) via a translation, a unitary transformation, and a scale factor change.  You do not change Aligned(:,:,1).  Therefore once performed, you can do no better on subsequent passes, so why are you repeating these with your while-loop?  If it repeats more than once, it will be due purely to round off differences.  The G0 value will remain essentially unchanged after the first trip through except for these rounding differences.

  (By the way, "(G1-G0) > tol" is ordinarily not the way to check for differences outside a tolerance.  You need "abs(G1-G0) > tol".  However, in the above case it may have saved you from an infinitely repeating while-loop.)

Roger Stafford