help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Solving A*x=b when A is full rank but numerically rank deficient


From: PetrSt
Subject: Re: Solving A*x=b when A is full rank but numerically rank deficient
Date: Thu, 27 Jun 2013 03:43:52 -0700 (PDT)

CdeMills wrote
> Sorry to contradict you. I went one step further:

I don't see any contradiction to what I wrote. In cotrary I think it proves
it.
As I understand to new lines:
AAmp = AA+mp(0);   % convert AA to mp-class
Bmp=AAmp*X;         % generate B as mp-class by precise calculation of AA*X
AAinv=inv(AAmp.'*AAmp);
x =  AAinv*(AAmp.'*Bmp);  % solve the linear system in least squares sence
as x=inv(A'*A)*(A'*B), where all variables are of mp-class, i.e. variable
(infinite) precision calculation.


CdeMills wrote
> As you may notice, ALL the solutions are correctly computed in the second
> case.

It agrees with the last example ("infP calculation with infP B") in the
"Ax_B_demo.m" send before, where even the Gauss's elimination gives
desirable result x==X for square A.
What I wanted to point out is necessity of knowing A and B precisely up to
more than 35 digits to achieve all x with minimal precision around 1e-4.
Bmp=AAmp*X surely satisfies this condition. If you are dealing with some
theoretical modeling etc. and such precision is accesible for your design
matrix and righthand side vector, then you don't need to read any further,
since the variable prec. calculation solves the problem.
I'm dealing with problems where A is represented by experimental conditions
or literature values and B is some measured state variable, all obtained
with some experimental error. In this case the idea of precisions higher
than let say 15 orders is from the dreamworld. If it threats to your real
calculations, you should examine the behaviour of solution with 
Bmp = B + mp(0);    % conversion to mp-class of B obtined by double prec.
computation of AA*X.
Bmp = AAmp*X + randn(size(X)).*abserr;   % abserr = absolute error
expectable for B (abserr~eps().*B~1e18 for the line above).

Regards
Petr




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Solving-A-x-b-when-A-is-full-rank-but-numerically-rank-deficient-tp4653604p4654902.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]