I'm currently running into trouble using leasqr function. In fact i'm making a non linear regression on the p vector using the function : y = (1/p(2))*(log((x-p(3))/EQF) - p(1));
as p(3) varies trought the leasqr algorithm and may produce negative values (x-p(3)<0), i may recover complex values.
I first decide to "redefine" a function log as follow: function y=monlog(x) if(x>0 && imag(x) == 0) y = log(x); else y = Inf; end
but the leasqr() function can't handle Inf values, so i'm trying to make the leasqr function to "forget" negative value by : else y = -100;
using this it works "well", but i might now run into singular matrices and recover ugly covariance matrices (covp) from the function.
So i wonder... Is there a way to *correctly* "redefine" this function under it's primal range [0; +Inf[ for leasqr to handle this
correctly ?
Thanks for ideas and paths you may propose. regards, Gian
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail