help-octave
[Top][All Lists]
Advanced

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

Re: leasqr: error: weighted residuals are not real


From: Przemek Klosowski
Subject: Re: leasqr: error: weighted residuals are not real
Date: Thu, 7 Apr 2016 10:48:54 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 04/07/2016 04:54 AM, Francesco Potortì wrote:
You include a code example, but you should also tell what happens when
you run it and how the outcome is different from what you expect.
Right, and the OP is more likely to get help if they simplified the problem.  I have something to do that I don't particularly like, so I took the opportunity to procrastinate and pare down their case to the following:
M=[  0.5   0; 1.1 0.2; 1.6 .3]
Mt=@(t,p) p(1) * (p(2) - p(3)*exp(-((p(4)*(t+p(5))).^p(6))))
pin=[1; 1; 1; 0.1; 0; 0]
leasqr(M(:,1), M(:,2), pin, Mt);
which displays the error you reported ("weighted residuals are not real")

I think it must be the fitted function Mt: apparently the way it's invoked by leasqr it generates 'not real'  or Inf/NaN values
for some values of the parameters (I also got "cannot take SVD of matrix containing Inf or NaN values" errors).

I didn't look in detail at the domain of their function; is it possible that it generates imaginary or NaN values for parameters close to your 'pin' values?


reply via email to

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