Re: problem with nonlinearfit

• To: mathgroup at smc.vnet.net
• Subject: [mg25555] Re: [mg25489] problem with nonlinearfit
• From: Timothy Stiles <tastiles at students.wisc.edu>
• Date: Sat, 7 Oct 2000 03:35:59 -0400 (EDT)
• References: <200010060350.XAA24764@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```I'm not sure if it's possible to specify a range to use for parameter
values in NonlinearFit, but it is possible to specify starting values by
giving a list of {parameter, starting value} instead of just a list of
parameters. It may be an "undocumented" feature, but it seems to work well.
For instance if your data is contained in the variable data and the
function is as you describe, you could use

NonlinearFit[data, (s/K)^(N a)*(t/a)^a, t, {{K, 5}, {N, 7}, {a, 9}}]

if you wanted to start the fit with K=5, N=7, a=9. You could use any other
starting values for the parameters, but if you want to specify a starting
value for one parameter, you have to specify a starting value for all
parameters, you can's use the following

NonlinearFit[data, (s/K)^(N a)*(t/a)^a, t, {{K, 5}, N, a}]

to specify a starting value for K but not for N or a.

Since Mathematica does not have a constrained minimization function, it may
not be possible to specify a "range" for the parameters.

-- Tim Stiles

Dragan Grgic wrote:

> Hi everybody,
>
> I have to fit the function e = (s/K)^(Na)*(t/a)^a    (s = constant;
> t = variable; K,N,a = parameters) to a given set of datas.
> Then, I have used the NonlinearFit function (Statistics'NonlinearFit'
> package), but I have two problems:
>
> 1) I can't specify any start values or range using. I tried to give them
> as any forms, but I always got error messages concerning these
> parameters.
>
> 2) mathematica shows kind of a strange behavior when repeating the fit
> operation, sometimes it keeps old values and sometimes it reports
> different error messages.
>
> Any help welcome,