[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: leasqr error
From: |
Martin Helm |
Subject: |
Re: leasqr error |
Date: |
Wed, 14 Nov 2012 14:05:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 |
I can see that problem when I (as your error message indicates) load the
control package and the optim package, it does not happen when I only do a
pkg load optim
and do not load control in parallel, this looks as if they contain
conflicting options functions.
octave:1> pkg load optim
octave:2> x=linspace(0, 5);
octave:3> y = 1./(1 + 1.2*x.^(1.8)) + randn(1,100)*0.03;
octave:4> function y = ffun(x, p)
> y = 1./(1+p(1)*x.^p(2));
> endfunction
octave:5> p = [0.5 0.0];
octave:6> [yfit pfit cvg iter] = leasqr(x, y, p, "ffun");
octave:7> cvg, iter, pfit
cvg = 1
iter = 6
pfit =
1.1887
1.8186
if your control package is set to autoload explicitly unload it and try
again.
pkg unload control
pkg load optim
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