Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1421

Re: NonlinearFit for specific data

From Alexei Boulbitch <alexei.boulbitch@iee.lu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: NonlinearFit for specific data
Date 2011-04-02 07:53 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <in6klr$2l2$1@smc.vnet.net> (permalink)

Show all headers | View raw


Dear Alex,

positions of arguments of parameters {a, b, c}
and variable, x, in your code is exchanged

(try this:
data2 = {{0, 773.59}, {30, 2351.12}, {60, 4205.8}, {90,
     4222.69}, {120, 4222.69}, {150, 704.328}, {180, 1388.28}, {210,
     1388.28}, {240, 1821.23}, {270, 1821.23}, {300, 754.109}, {330,
     773.59}, {360, 773.59}};
ff = FindFit[data2, Exp[a + b x + c*x^2], {a, b, c}, x]
Show[{ListPlot[data2], Plot[Exp[a + b x + c*x^2]
  /. ff, {x, 0, 400}]}]
)

However, its correction does not help.

I guess, that the data you have does not look like the curve you try to fit to it to the extent
that Mathematica is beaten out of a reason.

Probably a better idea would be to make the procedure "manually". My suggestion would be like follows:

Manipulate[

  res = Total[
    Table[(data2[[i, 2]] - a*Exp[b*x + c*x^2] /.
       x ->  data2[[i, 1]])^2, {i, 1, Length[data2]}]];
  Show[{ListPlot[data2],
    Plot[a*Exp[b *x + c*x^2], {x, 0, 400}]
    },
   Epilog ->
    Inset[Row[{Style["Residual=", 14], Style[res, 14]}],
     Scaled[{0.7, 0.8}]]
   ],

  {{a, 3000}, 0, 4000}, {b, -0.001, 0}, {c, -0.00001, 0}]

You can then play with limits for a, b and c to get a better curve. However, the residual is so huge,
that I believe that fitting of this data is in general a bad idea.

Have fun, Alexei


Dear Group,
I have the following data :
data2 = {  {0, 773.59},{30, 2351.12},{60, 4205.8}, {90, 4222.69},{120,
4222.69},{150, 704.328},
{180, 1388.28},{210, 1388.28},{240, 1821.23},{270, 1821.23},{300,
754.109},{330, 773.59},{360, 773.59}};
I want the following curve fit :
  NonlinearFit[data2, Exp[ a + b x + c x^2], x, {a, b, c}]
Unfortunatelly I get some "FindFit::sszero
FindMinimum::sszero" message, and the given result is ackward.
I also tried FindFit and NonlinearRegress without success.
Any comment would be very welcome.
Alex


-- 
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development

IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg

Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu

www.iee.lu

--

This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: NonlinearFit for specific data Alexei Boulbitch <alexei.boulbitch@iee.lu> - 2011-04-02 07:53 +0000

csiph-web