MathGroup Archive 2005

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

Search the Archive

Re: NonlinearFit - Logistic Function-CalcCenter3

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60468] Re: [mg60443] NonlinearFit - Logistic Function-CalcCenter3
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 17 Sep 2005 02:31:49 -0400 (EDT)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

expr=a/(1+b*Exp[-c*t]);
param={a,b,c};

data1={{-0.06,-0.05},{0.97,-4.2},
      {1.99,-9.79},{3,-12.44},
      {3.99,-14.57},{5.92,-16.85},
      {7.87,-17.27},{11.89,-17.69},
      {15.8,-17.74},{19.74,-17.77},
      {23.67,-18.19}};

param1=FindFit[data1, expr, param, t]

{a -> -17.5291,b -> 8.78665,c -> 1.05894}

Plot[expr/.param1,
    {t,Floor[Min[data1[[All,1]]]],
      Ceiling[Max[data1[[All,1]]]]},
    Frame->True,Axes->False,
    PlotRange->
      {Floor[Min[data1[[All,2]]]]-1,
        Ceiling[Max[data1[[All,2]]]]+1},
    PlotStyle->Blue,
    Epilog->{Red,AbsolutePointSize[4],Point/@data1}];

data2={{-0.08,0.05},{0.96,-3.19},
      {1.93,-6.4},{2.98,-10.32},
      {3.97,-11.8},{5.92,-13.98},
      {7.88,-14.12},{11.85,-15.34},
      {15.79,-14.61},{19.7,-15.43},
      {23.67,-15.83}};

For the second data set, specify the Method as either Gradient or 
QuasiNewton

FindFit[data2, expr, param, t,
  Method->QuasiNewton]

{a -> -14.9178,b -> 10.2846,c -> 1.00721}

param2=FindFit[data2, expr, param, t,
    Method->Gradient]

{a -> -14.9179,b -> 10.2927,c -> 1.00749}

Plot[expr/.param2,
    {t,Floor[Min[data2[[All,1]]]],
      Ceiling[Max[data2[[All,1]]]]},
    Frame->True,
    Axes->False,
    PlotRange->
      {Floor[Min[data2[[All,2]]]]-1,
        Ceiling[Max[data2[[All,2]]]]+1},
    PlotStyle->Blue,
    Epilog->{Red,AbsolutePointSize[4],Point/@data2}];


Bob Hanlon

> 
> From: Oddur Bjarnason <oddur.bjarnason at broadpark.no>
To: mathgroup at smc.vnet.net
> Date: 2005/09/16 Fri AM 03:50:36 EDT
> Subject: [mg60468] [mg60443] NonlinearFit - Logistic Function-CalcCenter3
> 
> 
> I can fit a logistic function of the form 
> a/(1 + b*Exp[-c*t])
> 
> to the data points -0.06 -0.05 
>       0.97 -4.2 
>       1.99 -9.79 
>       3 -12.44 
>       3.99 -14.57 
>       5.92 -16.85 
>       7.87 -17.27 
>       11.89 -17.69 
>       15.8 -17.74 
>       19.74 -17.77 
>       23.67 -18.19 
> 
> 
> I can not fit the same function to the data points
>       -0.08 0.05 
>       0.96 -3.19 
>       1.93 -6.4 
>       2.98 -10.32 
>       3.97 -11.8 
>       5.92 -13.98 
>       7.88 -14.12 
>       11.85 -15.34 
>       15.79 -14.61 
>       19.7 -15.43 
>       23.67 -15.83 
> 
> 
> I have tried to do it with Mathematica without success.
> 
> I have no problem when I use a progam called CurveExpert.
> 
> Regards, Oddur Bjarnason
> 
> 
> 


  • Prev by Date: Re: Bug in Reduce?
  • Next by Date: Re: solve for a squared variable
  • Previous by thread: NonlinearFit - Logistic Function-CalcCenter3
  • Next by thread: Re: NonlinearFit - Logistic Function-CalcCenter3