MathGroup Archive 2005

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

Search the Archive

Re: Coefficients from Fit as a list?


On Thursday, December 29, 2005 at 02:57 GMT -0500, Lectorz wrote:

> How can I store the coefficients from the Fit function as a list?

Use FindFit instead:

data = Table[{i, Random[] + 5 i}, {i, 10}];
Fit[data, {x, 1}, x]
FindFit[data, m x + b, {b, m}, {x}][[All, 2]]

Or you could use the LinearRegression package and obtain a whole lot
more information in the process.

<< Statistics`LinearRegression`
bestfit = Regress[data, {1, x}, x]
(ParameterTable /. bestfit)
(ParameterTable /. bestfit)[[1, All, 1]]



  • Prev by Date: Retaining variable/function expressions from session to session
  • Next by Date: Re: Coefficients from Fit as a list?
  • Previous by thread: Coefficients from Fit as a list?
  • Next by thread: Re: Coefficients from Fit as a list?