Lsqnonlin : the initial values don't vary and Genetic Algo is too slow (791 variables)
1 view (last 30 days)
Show older comments
Hello,
I am used to fminsearch (and fminsearchbnd provided by a User of this forum which works very well) but this time I need to minimize a function of 791 variables.
That's why I am trying the lsqnonlin. I have computed the function and not the Sum of the squared as the method requires it. The function is a sum from 1 to 39 so the function coded returns a column (39x1)
The issue is that lsqnonlin doesn't seem to make any variation from the initial values. I have tried other intial values and nothing changed.
[x,fval,exitflag,output]=lsqnonlin(@(x)ObjectiveStep5LSQ(x,SigmaS,k0,ZCcurve,gFunction,ag,bg,cg,dg,SwapLengths,Talpha,Tbeta,w,FwdIni,BetaS, ForwardSwapRate,delta_k),D,[],[],optimset('Display','iter-detailed','TolFun',10^-14,'TolX',10^-14,'MaxFunEvals',4000));
I have checked that the initial values are properly passed to the process and it is the case. Is there something I am missing ?
Additional information: In fact, it is a correlation matrix (39x39). Therefore I just need to calibrate the TriL without the diagonal as it has to be one. As initial guess I use exp(-b*abs(i-j)) with a given b. I couldn't put the boundaries conditions as each Function_k depends on 38 variables.
I have also tried the Genetic Algorithm (ga) and it seems to converge but it very very slow. I think it would take a week to complete (or not) the procedure.
Thank you for your help
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!