fit nonlinear model to data - better way to code it?



On Thu, May 17, 2012 at 12:25 PM, Ether Jones <maxima at etherjones.us> wrote:

>
>
> p:[p1,p2,p3]$
> f(x):=p[1]+p[2]/(x-p[3])$
>

I guess this actually works, but p is supposed to be a list of the
parameters and f(x) should be an expression containing the parameters:

f(x) := p1 + p2/(x-p3)

minpack(f(x)-y,[p1,p2,p3],guess);

Ray