? numerical TLS
- From: "Cheng Cosine" <acosine@xxxxxxxxxx>
- Date: Thu, 26 Apr 2007 22:52:11 -0400
Hi:
Though TLS has closed form soln, I'm curious what if I calculate it
numerically.
Below is a MatLab script I used to test this. But it does not converge close
to closed
form. Any way to improve it or what did I make wrong?
Thanks,
by Cheng Cosine
Apr/26/2k7 NC
% setup the system
M = 7; N = 5;
A = magic(max(M,N)); A = A(1:M,1:N);
b = linspace(1,M,M)';
x = pinv(A)*b;
% setup the noise
NoiseA = rand(size(A));
Noiseb = rand(size(b));
% setup the noisy system
ANoisy = A+NoiseA;
bNoisy = b+Noiseb;
% numerically solve TLS problem
x0 = rand(N,1); % initial guess
[xTLSNum, resnorm, residual, exitflag, output, lambda] = ...
lsqnonlin(@funcTLS, x0, [], [], [], [bNoisy, ANoisy]);
function y = funcTLS(x, AExtend)
x = x./norm(x);
xExtend = [-1.0; x];
y = AExtend*xExtend;
.
- Follow-Ups:
- Re: ? numerical TLS
- From: Peter Spellucci
- Re: ? numerical TLS
- Prev by Date: Re: cubic convolution interpolation at boundaries?
- Next by Date: Re: cubic convolution interpolation at boundaries?
- Previous by thread: Boundary conditions in implicit methods
- Next by thread: Re: ? numerical TLS
- Index(es):
Relevant Pages
|