MathGroup Archive 2001

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

Search the Archive

Re: Can Fit give function coefficients?

  • To: mathgroup at
  • Subject: [mg31139] Re: Can Fit give function coefficients?
  • From: bap at (Brett Patterson)
  • Date: Sat, 13 Oct 2001 02:47:04 -0400 (EDT)
  • References: <9pu3u0$bc8$>
  • Sender: owner-wri-mathgroup at


I'd just like to summarise the feedback I've received so far,
since I think this thread is probably thinning out now.

Firstly, thank you everyone for responding to my question.

I have great suggestions in particular from:
Jens-Peer Kuska (kuska at --- using NumericQ
and BobHanlon at (BobHanlon at --- using NonlinearFit.
Both are succinct and easy to implement, so I'm happy now! 8-)

I'd also like to share the following that I received via
private email from someone "Siegman" at Stanford:

> Here's a pointer to an expanded version of the standard  
> Fit[]  routine that 
> also gives the coefficients.
>    http://www-ee.Stanford.EDU:80/~siegman/SimpleFit.txt

This SimpleFit function actually does exactly what I
was wanting, and it's fast!

Finally, thank for your help Yas, from Melbourne,
but for future reference, it's probably not a good
idea to post Notebooks as attachments to group lists.

Brett Patterson

"Brett Patterson" <bap at> wrote in message news:<9pu3u0$bc8$1 at>...
> I have a set of functions that I wish to fit to some data.
> Is there a way to succinctly get Mathematica to give me
> the coefficients of these functions in the fit.
> For example, say I have
> f1[x_] := 2 x^2
> f2[x_] := 3 x^3
> Normally, if I say: Fit[data, {1, f1[x], f2[x]}, x]
> I get a result in the form: a1 + b1 x^2 + c1 x^3,
> but I want a result of the form: a2 + b2 f1[x] + c2 f1[x].
> In this case, a2 = a1, b2 = b1/2, and c2 = c1/3.
> Is this possible?
> Regards,
> Brett Patterson

  • Prev by Date: Re: Re: Assumptions question (1/m^x,x>1,m=Infinity)
  • Next by Date: data files
  • Previous by thread: Re: Can Fit give function coefficients?
  • Next by thread: Newbie question