Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Help with an error with NonlinearModelFit,

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99560] Re: [mg99525] Help with an error with NonlinearModelFit,
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Fri, 8 May 2009 00:13:55 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

Your model needs some explicit multipliers or spaces.

{am, bm, cm} = {
   1 + RandomReal[],
   2 + RandomReal[],
   8 + RandomReal[]}

{1.48798,2.46428,8.91346}

data = Table[{k, Log[am*k^2 + bm*k + cm + RandomReal[]]}, {k, 35}];

nlm = NonlinearModelFit[data, Log[a*k^2 + b*k + c], {a, b, c}, k];

nlm // Normal

Log[1.4834808148709797*k^2 +
      2.5953464393454073*k +
      8.874882556234564]



Bob Hanlon


On Thu, May 7, 2009 at 8:12 AM , Anonymous wrote:

> I'm trying to find a fit to a large set of data.
>
> Here are In[1], In[2].
>
> In[1] := {{421.1, 6591.10}, ...};
>
> (there are way more points, in fact there are 35 in total, but I don't
> want to list them.  All are real numbers.)
>
> In[2] := nlm = NonlinearModelFit[data, Log[ak^2 + bk + c], {a,b,c}, k]
>
> Then mathematica gives an error that basically says that the function
> "is not a list of real numbers"
>
> Of course it is, so how do I fix this?


  • Prev by Date: Re: Given a matrix, find position of first non-zero element in each
  • Next by Date: can we save indexed colored images in v7?
  • Previous by thread: Re: InputField in Dialog or Document Windows
  • Next by thread: can we save indexed colored images in v7?