MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NonLinearFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg21051] Re: [mg20949] NonLinearFit
  • From: BobHanlon at aol.com
  • Date: Sun, 12 Dec 1999 23:51:16 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Needs["Statistics`NonlinearFit`"];

data = {{1.0, 1.0, .126}, {2.0, 1.0, .219}, {1.0, 2.0, .076}, {2.0, 
        2.0, .126}, {.1, .0, .186}};

model = theta1 theta3 x1/(1 + theta1 x1 + theta2 x2);

var = {x1, x2};


"If a parameter is specified as {symbol, {start0, start1}} or {symbol, 
{start0, start1}, min, max}, then the search for parameter estimates uses 
start0 and start1 as the first two values of symbol. This form must be used 
if symbolic derivatives of chi^2 with respect to the parameters cannot be 
found."

param = {{theta1, {3., 4.}}, {theta2, {10., 20.}}, {theta3, {.5, 1.5}}};

NonlinearFit[data, model, var, param]

FindMinimum::"fmwar": "When Method -> LevenbergMarquardt, Newton or \
QuasiNewton only the first starting value in each dimension will be used."

(2.442768613619702*x1)/(1 + 3.131497065518828*x1 + 
   15.159361227431797*x2)

NonlinearRegress[data, model, var, param, 
  RegressionReport -> {BestFit, BestFitParameters, StartingParameters}]

FindMinimum::"fmwar": "When Method -> LevenbergMarquardt, Newton or \
QuasiNewton only the first starting value in each dimension will be used."

{BestFit -> (2.442768613619702*x1)/
    (1 + 3.131497065518828*x1 + 15.159361227431797*x2), 
  BestFitParameters -> {theta1 -> 3.131497065518828, 
    theta2 -> 15.159361227431797, 
    theta3 -> 0.7800641554217721}, StartingParameters -> 
   {{theta1 -> 3., theta2 -> 10., theta3 -> 0.5}, 
    {theta1 -> 4., theta2 -> 20., theta3 -> 1.5}}}

Bob Hanlon

In a message dated 12/1/1999 3:40:24 AM, l42549 at alfa.ist.utl.pt writes:

> I have a very boresome problem. I know it should be obvious but I can't
>get  it done.
> I want to give starting parameters to NonLinearFit, or NonLinearRegress.
>How can I do that? By default it starts with 1 for every parameter I'm
>fitting.
>


  • Prev by Date: how to use NonlinearRegress w. NDSolve model?
  • Next by Date: Q: efficient in-place list element replacement?
  • Previous by thread: Re: how to use NonlinearRegress w. NDSolve model?
  • Next by thread: Q: efficient in-place list element replacement?