Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Getting parameters from Fit[]..

  • To: mathgroup at
  • Subject: [mg27136] Re: [mg27055] Getting parameters from Fit[]..
  • From: "Mark Harder" <harderm at>
  • Date: Wed, 7 Feb 2001 02:12:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Thank you all for responding so quickly to my request.  You are correct
about Regress.  It does not print when terminated with a semicolon (as
expected).  I don't understand why this did not work for me before.

-----Original Message-----
From: BobHanlon at <BobHanlon at>
To: mathgroup at
<mathgroup at>
Subject: [mg27136] Re: [mg27055] Getting parameters from Fit[]..

>        150},{0.232,172},{0.248,189},{0.284,209},{0.351,253}};
>funcs = {1, x, x^2};
>bfp=(BestFitParameters /.
>        Regress[data, funcs, x, RegressionReport -> BestFitParameters]);
>bfp.funcs == Fit[data, funcs, x]
>funcs = {1, x^2};
>bfp=(BestFitParameters /.
>        Regress[data, funcs, x, RegressionReport -> BestFitParameters]);
>bfp.funcs == Fit[data, funcs, x]
>Bob Hanlon
>In a message dated 2001/2/3 5:25:07 AM, harderm at writes:
>>I am doing a linear fit to obtain parameters for use in a larger,
>>iterative procedure (a separable linear-nonlinear data fitting
>>algorithm), and I'm trying to use Fit[] to do this.  Unfortunately, Fit
>>does not return parameters by themselves, just the linear combination of
>>my basis functions(which are much more complicated than the usual
>>examples given in the documentation) weighted by the parameters.  I have
>>tried various things, like using Regress instead of Fit, but that prints
>>out at least a written report of the parameters every time it is
>>invoked, which will make for a very cluttered output when included in
>>the larger problem I am trying to solve.  I suppose I can find a method
>>to isolate just the parts of the output of Fit that contain the
>>parameters and process them to get the parameters, but that seems
>>awkward and might introduce numerical errors.  I've looked at the
>>MathGroup archives and found only 1 response to this question in the
>>past, which was "Sorry, dont know how to do that. why don't you use
>>    Doesn't Mathematica provide any simple method for recovering just
>>the parameter vector from a linear fit?  If it doesn't, perhaps it ought
>>to.  Alternatively, is there some way to get Regress to provide the
>>BestFitParameters rules without printing them out?  Or, is there some
>>*simple* and accurate way of getting the parameters from the Fit output
>>as is?

  • Prev by Date: Re: Parametric Plot Again
  • Next by Date: Re: Graphic problem
  • Previous by thread: Re: Getting parameters from Fit[]..
  • Next by thread: limits of the warping algorithmus? (digital image processing)