Scilab Function
Last update : 1/11/2005
polyfit - Calculates the polynomial
fitting
Calling Sequence
-
[SSE,r,b] =
polyfit(xx,yy,p)
Parameters
-
xx
: x-value of data sets
-
yy
: y-value of data sets
-
p
: polynomial degree
-
SSE
: squared sum error
-
r
: correlation coefficient
-
b
: optimal polynomial coefficients
Description
-
A classcial linear equation system to minimze the quadratic errors
is solved.
Examples
x=rand(1,20,'normal');
a=[3,2,-4,1.5];
y=polyval(a,x);
// cubic polynomial
[SSE,r,b]=polyfit(x,y,3)
// square polynomial
[SSE,r,b]=polyfit(x,y,2)
See Also
polyval
,
Authors
-
Dr. Andreas Geissler geisslea@web.de
Used Function
vandermonde