[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: leasqr error
From: |
Ben Abbott |
Subject: |
Re: leasqr error |
Date: |
Wed, 14 Nov 2012 08:00:11 -0500 |
On Nov 14, 2012, at 7:52 AM, Juan Pablo Carbajal wrote:
> On Wed, Nov 14, 2012 at 1:48 PM, SBoris <address@hidden> wrote:
>> I ran the code
>> <http://my.safaribooksonline.com/book/-/9781849513326/more-examples-data-analysis/ch07lvl1sec06>
>> :
>>
>> x=linspace(0, 5); y = 1./(1 + 1.2*x.^(1.8)) + randn(1,100)*0.03;
>> function y = ffun(x, p)
>> y = 1./(1+p(1)*x.^p(2));
>> endfunction
>> p = [0.5 0.0];
>> [yfit pfit cvg iter] = leasqr(x, y, p, "ffun");
>> cvg, iter, pfit
>> leasqr(x,y,pin,F,{stol,niter,wt,dp,dFdp,options})
>>
>> And have got the error message:
>> error: Invalid call to options. Correct usage is:
>>
>> -- Function File: OPT = options ("KEY1", VALUE1, "KEY2", VALUE2, ...)
>>
>> error: called from:
>> error: /usr/share/octave/3.6.2/m/help/print_usage.m at line 87, column 5
>> error: /usr/share/octave/packages/control-2.3.52/options.m at line 68,
>> column
>> 5
>> error: evaluating argument list element number 1
>> error: /usr/share/octave/packages/optim-1.2.0/leasqr.m at line 577, column
>> 5
>>>>> error:
>> /home/boris/Documents/Octave/Compartment-models/Calcs/leasqr/lasqr_
>> simple.m at line 6, column 26
>>
>> I read post at leasqr question (again)
>> <http://octave.1599824.n4.nabble.com/leasqr-question-again-td4644120.html>
>> and did changes in my leasqr.m as it was mentioned in the post. But in my
>> case the error is at line 577. Could you help me?
>>
>
> The cell you pass to leasqr is undefined
>> {stol,niter,wt,dp,dFdp,options}
> What are all these things?
>
> The error says that "options" is being parsed as a function.
The error is from line ...
leasqr(x,y,pin,F,{stol,niter,wt,dp,dFdp,options})
Which is *not* part of the example at the link you provided. You have not
defined many of the variables in this call to leasqr. In particular "options"
has not been defined.
Ben