Mathematica 9 is now available

Fit

Usage

Fit[data, funs, vars] 找一个数据列的最小二乘拟合,这个拟合是作为一个以 vars为自变量的函数funs的线性组合。
• 数据有形式    ,  , ... ,   ,   ,  , ... ,   , ...  , 其中坐标数 x, y, ... 等于在列表vars中的变量数。
• 数据可以有形式   ,  , ...  , 有一个坐标假设是取值1, 2, ... .
• 参数 funs可以是任何仅依赖于对象vars的函数列表。


Notes

Fit[  ,  , ...  ,  1, x, x^2 , x]对值 的序列给出了二次拟合。结果有形式 +  x +  x^2, 其中 是实数。 需要获得 x 的其他值假设是 1, 2, ... .
Fit[   ,   ,   ,   , ...  ,  1, x, x^2 , x] 假设x 的值 序列进行二次拟合。
Fit[   ,  ,   , ...  ,  1, x, y ,  x, y ] 求形式  +  x +  y的拟合。
Fit 总是求在列表中的函数的线性组合,使得最小化由值  得出的平方和。
• 作为Fit的输入给出的精确数被转化为有机器精度的近似数。
• 参见Mathematica全书: 1.6.6节 和 3.8.1节.
• 实现注释: 参见 A.9.4节.
Further Examples

You will have to evaluate all the cells in this example to regenerate the data used for the plots.

Here is a table of the first 20 primes.

In[1]:=  

Here is a plot of this data.

Evaluate the cell to see the graphic.

In[2]:=  

This gives a quadratic fit to the data.

In[3]:=  

Here is a plot of the quadratic fit.

Evaluate the cell to see the graphic.

In[4]:=  

This shows the quadratic fit superimposed on the original data. The quadratic fit is better than the linear one.

Evaluate the cell to see the graphic.

In[5]:=  

This gives a table of the values of an exponential function for x from 1 to 10 in steps of 1.

In[6]:=  

Out[6]=

This fit recovers the original functional form.

In[7]:=  

Out[7]=

If you include other functions in the list, Fit determines that they occur with small coefficients.

In[8]:=  

Out[8]=

You can use Chop to get rid of the terms with small coefficients.

In[9]:=  

Out[9]=

In[10]:=  



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.