help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: refining log to ]0; +Inf[


From: Przemek Klosowski
Subject: Re: refining log to ]0; +Inf[
Date: Wed, 1 Aug 2007 14:49:30 -0400 (EDT)

   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.

Well, when the argument of the log() is near zero, the function is
obviously very sensitive to the value of p(3), and introducing large
discontinuities will throw off the convergence. 

It'll probably be better if you simply limited the range of p(3) to
the range which guarantees that your objective function y is
well-defined for all values of your x

         p(3) < min(x)

One way to do that is by variable substitution p(3) -> Xmin-exp(p(3)),
so that you'll fit:
         
   y = (1/p(2))*(log(((x-Xmin)+exp(p(3)))/EQF) - p(1));

your original p(3) can be then calculated from the fitted value.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]