The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to deal with complex nonlinear least square problem?
Replies: 4   Last Post: Nov 28, 2012 9:06 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 10
Registered: 4/13/12
Re: How to deal with complex nonlinear least square problem?
Posted: Nov 28, 2012 9:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Torsten" wrote in message <k958kk$1mm$>...
> "flying" wrote in message <k9567n$lea$>...
> > Thank you very much!
> >
> > I've encountered another problem.I met the error "optimization terminated norm of the current step is less than options tolx" when i use 'lsqnonlin' function.This means that the outcome is the same as the initial values i set,so how to deal with it?
> >
> > Sincerely
> > frank

> There seems to be an error in your problem set-up, but nothing useful can be said
> unless we see the relevant part of your MATLAB code.
> Best wishes
> Torsten.

My code is to deal with a multivariables problem.There are many parameters to be optimized.The vectors: 'sigAmpEst' 'alphaEst' 'rEst' have the same dimension.
My problem is that i only get the initial parameters when i use 'lsqnonlin',maybe the model to be optimized is too complicated or the parameters to be estimated is too many.I don' t konw why,any good idea?

options = optimset('Display','iter','MaxFunEvals',5e3,'MaxIter',1000,'TolFun',1e-7,'TolX',1e-11);
[x,renorm,residual,exitflag,output] = lsqnonlin(@lsqnonlinCE,[real(sigAmpEst) imag(sigAmpEst) alphaEst rEst],[],[],options);

function y=lsqnonlinCE(z)
% Function used in 'lsqnonlin.m'

global pi2 c lj yk1 yk2 fk1 fk2 sigAmpEst

N = length(sigAmpEst);
NL = length(yk1);
NH = length(yk2);
ykce1 =[];
ykes1 =[];
for ii = 1:NL
for jj = 1:N
ykce1 = [ykce1 (z(jj) + lj*z(jj+N))*exp(-z(jj+2*N)*fk1(ii))*exp(-lj*2*pi2*z(jj+3*N)*fk1(ii)/c)];
ykce1 = sum(ykce1);
ykes1 = [ykes1 abs(yk1(ii) -ykce1)];

ykce2 =[];
ykes2 =[];
for ii =1:NH
for jj = 1:N
ykce2 = [ykce2 (z(jj) + lj*z(jj+N))*exp(-z(jj+2*N)*fk2(ii))*exp(-lj*2*pi2*z(jj+3*N)*fk2(ii)/c)];
ykce2 = sum(ykce2);
ykes2 = [ykes2 abs(yk2(ii) -ykce2)];

y = [ykes1 ykes2];


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.