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

MathGroup Archive 2011

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

Search the Archive

Making a function from the output of the Fit function.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121489] Making a function from the output of the Fit function.
  • From: Just A Stranger <forpeopleidontknow at gmail.com>
  • Date: Sat, 17 Sep 2011 06:25:53 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hello,

So I am trying to use the Fit ffunction to make another function.

So I want to do something like this:

f[x_] := Fit[ data, {1,x}, x]

But I want f[x] to be the function for the line, a+bx. But as written above
it does not have this result of course (I know it's because whatever gets
passed is used as an argument for the fit function, so passing a number
doesn't work, and passing a variable simply isn't what I want to do) So how
can I use the fit function to get
f[x_] :=  a+bx (where a and b are the appropriate constants. )

My jerry rigged solution is to just execute Fit[ data, {1,x}, x] then copy
and past the output to define a function. But this tacky solution just won't
do :)

Thank you for your help mathgroup.



  • Prev by Date: String Deletion
  • Next by Date: Re: How create new style sheet- Mathematica 8
  • Previous by thread: Re: String Deletion
  • Next by thread: Re: Making a function from the output of the Fit function.