Nonlinear Estimation with Optimize

Thomas D. Dean tomdean at speakeasy.org
Sat Aug 23 16:34:34 CDT 2008


Octave 3.0.2

I installed optim-1.0.3.tar.gz, and changed is_list() to islist() to
remove a warning message.  The files are:
  optim-1.0.3/minimize.m
  optim-1.0.3/d2_min.m
  optim-1.0.3/nelder_mead_min.m

I have a problem with argument syntax.  I think I need to use minimize()
and pass a function that uses three arguments.  I have a simplified
example.

Here is what I want to do (wrong?):

t = [3.3598, 26.4377, 89.6760, 211.5766, 414.1391, ...
     716.1501, 1128.1406 ]';
for i=1:7
  s(i,1)=1000*i;
end;
## I wanted to use s(i)=1000*i and then s=s'
## but, octave seemed to ignore that.
x0=[0,0,0]';
l={x0,s,t};  ## a list to pass to minimize

function r = fit(l)
  a0=nth(l,1); b=nth(l,2); c=nth(l,3);
  r = c - [b.^2,b,ones(7,1)]*a0;
end

[x,v,n]=minimize("fit",l)  ## I want to use fit(x0,s,t) 

What am I doing wrong?

tomdean



More information about the Help-octave mailing list