MathGroup Archive 2001

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

Search the Archive

Re: Exponential fit question.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28039] Re: [mg27986] Exponential fit question.
  • From: "Sherman Reed" <sherman.reed at worldnet.att.net>
  • Date: Thu, 29 Mar 2001 03:24:07 -0500 (EST)
  • References: <200103270626.BAA21789@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Joe,
certainly the use of Fit with Exp does not work.

I resort to fundamentals in this problem.  I took the natural log of the
y values, and then fitted a first order linear equation.

working this backward, I got 5.22289*Exp[.03795*x]

I plotted this versus your data and the fit was reasonable.

I plotted your Excel result versus your data and this was
substantially poorer. I suspect an error in the Excel work.

the code is attached.

Sherman C. Reed
sherman.reed at att.net
----- Original Message ----- 
From: "joe" <joe at wam.umd.edu>
To: mathgroup at smc.vnet.net
Subject: [mg28039] [mg27986] Exponential fit question.


> hello.
> 
> I was wondering if someone could help me with the following problem.
> 
> I am trying to perform an exponential fit to the following data
> {{x,y}}
> 
> data
> ={{50,22},{64,62},{78,122},{93,269},{107,414},{122,507},{136,597}}
> 
> Fit[data,Exp[x],x]
> 
> what I get is 
> 
> 1.94272422061017735^-63 *E^x Which is not correct.
> 
> With Excel I get 7.5*E^0.0034x which is correct.
>  
> How can I do this with Mathematica ?
> 
> Thanks.
> -Joseph.
> 
> 
> 

------=_NextPart_000_0017_01C0B72D.8D281700
	filename="zzstan.nb"

(************** Content-type: application/mathematica **************

                    Mathematica-Compatible Notebook

This notebook can be used with any Mathematica-compatible
application, such as Mathematica, MathReader or Publicon. The data
for the notebook starts with the line containing stars above.

To get the notebook into a Mathematica-compatible application, do
one of the following:

* Save the data starting with the line of stars above into a file
  with a name ending in .nb, then open the file inside the
  application;

* Copy the data starting with the line of stars above to the
  clipboard, then use the Paste menu command inside the application.

Data for notebooks contains only printable 7-bit ASCII and can be
sent directly in email or through ftp in text mode.  Newlines can be
CR, LF or CRLF (Unix, Macintosh or MS-DOS style).

NOTE: If you modify the data for this notebook not in a Mathematica-
compatible application, you must delete the line below containing
the word CacheID, otherwise Mathematica-compatible applications may
try to use invalid cache data.

For more information on notebooks and Mathematica-compatible 
applications, contact Wolfram Research:
  web: http://www.wolfram.com
  email: info at wolfram.com
  phone: +1-217-398-0700 (U.S.)

Notebook reader applications are available free of charge from 
Wolfram Research.
*******************************************************************)

(*CacheID: 232*)


(*NotebookFileLineBreakTest
NotebookFileLineBreakTest*)
(*NotebookOptionsPosition[      2594,         82]*)
(*NotebookOutlinePosition[      3677,        116]*)
(*  CellTagsIndexPosition[      3633,        112]*)
(*WindowFrame->Normal*)



Notebook[{
Cell[BoxData[
    StyleBox[\(data = {{50, 22}, {64, 62}, {78, 122}, {93, 
            269}, \[IndentingNewLine]{107, 414}, {122, 507}, {136, 597}}\),
      FormatType->StandardForm]], "Input"],

Cell[BoxData[{
    \(\(newdata = Table[{0, 0}, {i, 7}];\)\), "\[IndentingNewLine]", 
    \(For[i = 1, 
      i < 8, \(i++\), {newdata[\([i, 1]\)] = data[\([i, 1]\)], 
        newdata[\([i, 2]\)] = N[Log[data[\([i, 2]\)]]]}]\)}], "Input"],

Cell[BoxData[
    \(Fit[newdata, {1, x}, x]\)], "Input"],

Cell[BoxData[
    \(Exp[1.65305]\)], "Input"],

Cell[BoxData[
    \(raw = ListPlot[data, PlotJoined \[Rule] True]\)], "Input"],

Cell[BoxData[
    \(mine = Plot[5.22289*Exp[ .03795*x], {x, 50, 136}]\)], "Input"],

Cell[BoxData[
    \(his = Plot[7.5*Exp[ .0034*x], {x, 50, 136}]\)], "Input"],

Cell[BoxData[
    \(Show[his, raw]\)], "Input"],

Cell[BoxData[
    \(Show[raw, mine]\)], "Input"]
},
FrontEndVersion->"4.1 for Microsoft Windows",
ScreenRectangle->{{0, 1024}, {0, 695}},
WindowToolbars->{"RulerBar", "EditBar"},
WindowSize->{922, 664},
WindowMargins->{{-10, Automatic}, {-38, Automatic}},
PrintingCopies->1,
PrintingPageRange->{Automatic, Automatic},
PageFooters->{{Inherited, Cell[ 
        TextData[ {
          ValueBox[ "Date"], "\n", 
          ValueBox[ "Time"]}], "Footer"], Cell[ 
        TextData[ {
          ValueBox[ "Date"], "\n", 
          ValueBox[ "Time"]}], "Footer"]}, {Inherited, None, Inherited}},
PrivateFontOptions->{"FontType"->"Outline"},
Magnification->1.5
]

(*******************************************************************
Cached data follows.  If you edit this Notebook file directly, not
using Mathematica, you must remove the line containing CacheID at
the top of  the file.  The cache data will then be recreated when
you save this file from within Mathematica.
*******************************************************************)

(*CellTagsOutline
CellTagsIndex->{}
*)

(*CellTagsIndex
CellTagsIndex->{}
*)

(*NotebookFileOutline
Notebook[{
Cell[1705, 50, 192, 3, 66, "Input"],
Cell[1900, 55, 237, 4, 92, "Input"],
Cell[2140, 61, 56, 1, 41, "Input"],
Cell[2199, 64, 45, 1, 41, "Input"],
Cell[2247, 67, 78, 1, 41, "Input"],
Cell[2328, 70, 82, 1, 41, "Input"],
Cell[2413, 73, 76, 1, 41, "Input"],
Cell[2492, 76, 47, 1, 41, "Input"],
Cell[2542, 79, 48, 1, 41, "Input"]
}
]
*)



(*******************************************************************
End of Mathematica Notebook file.
*******************************************************************)


------=_NextPart_000_0017_01C0B72D.8D281700--


  • Prev by Date: RE: Memory leak
  • Next by Date: Re: Comments on developer conferences
  • Previous by thread: Re: Exponential fit question.
  • Next by thread: Re: Exponential fit question.