comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Transpose(A)*P*A
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Transpose(A)*P*A [message #62831 is a reply to message #62825] Sat, 11 October 2008 12:42 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"mapper4u6@gmail.com" <zjwang2u@gmail.com> writes:

> hello,
>
> I have a question about how to improve the computation speed when deal
> with non-linear equation
> A x = l, P is the weight for each
> row, P is M*M
> M*N N*1 M*1
>
> then I have to build normal matrix which is
> Transpose(A)*P*A x = Transpose(A)*P*l
> N*N N*1 N*1
>
> then x can be solved.

I'm going to channel our vice presidential candidate and answer a
different question.

It looks like you are trying to solve a least squares problem. It's
well documented that the normal equation method suffers from accuracy
problems, basically because you are squaring the A matrix, and thus
squaring the errors. Have you tried SVD or QR factorization?
Implemented correctly, the execution times should scale as,
Normal equation ~ N^2 * ( M + N/3)
QR ~ N^2 * (2*M - 2*N/3)
SVD ~ N^2 * (2*M +11*N/3)
On its face, QR factorization will take longer (not more than double
the time though), but it is known to be more stable.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: cbmarkwardt+usenet@gmail.com
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Another MPFIT question
Next Topic: ARGHHHH Min_Curv_Surf !!!!!!!!!!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:16:39 PDT 2025

Total time taken to generate the page: 0.00433 seconds