Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
flying

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$1@newscl01ah.mathworks.com>...
> "flying" wrote in message <k9567n$lea$1@newscl01ah.mathworks.com>...
> > 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)];
end
ykce1 = sum(ykce1);
ykes1 = [ykes1 abs(yk1(ii) -ykce1)];
end

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)];
end
ykce2 = sum(ykce2);
ykes2 = [ykes2 abs(yk2(ii) -ykce2)];
end

y = [ykes1 ykes2];



Sincerely
Frank



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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.