Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <ia6550$11n$1@fred.mathworks.com> <iacbe0$t4h$1@fred.mathworks.com> <iadnhs$49n$1@fred.mathworks.com> <iadqfl$7q7$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1288381983 29815 172.30.248.38 (29 Oct 2010 19:53:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 29 Oct 2010 19:53:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:682465

"Shyamal L" <lshyamalNOSPAM@yahoo.com> wrote in message <iadqfl$7q7$1@fred.mathworks.com>...
> ........
> 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