Artifact 4365783e49dc08c8721163dcc35bf4e2c38d926ab89399ef3358f0756755e4e5:
- Executable file
r37/lisp/csl/html/r37_0431.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1532) [annotate] [blame] [check-ins using] [more...]
<A NAME=num_fit> <TITLE>num_fit</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>NUM_FIT</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>operator</B><P> <P> <P> <P> The operator <em>num_fit</em> finds for a set of points the linear combination of a given set of functions (function basis) which approximates the points best under the objective of the <em>least squares</em> criterion (minimum of the sum of the squares of the deviation). The solution is found as zero of the gradient vector of the sum of squared errors. <P> <P> <P> <H3> syntax: </H3> <em>num_fit</em>(<vals>,<basis>,<var>=<pts>) <P> <P> <P> where <vals> is a list of numeric values, <var> is a variable used for the approximation, <pts> is a list of coordinate values which correspond to <var>, <basis> is a set of functions varying in <em>var</em> which is used for the approximation. <P> <P> The result is a list containing as first element the function which approximates the given values, and as second element a list of coefficients which were used to build this function from the basis. <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> pts:=for i:=1 step 1 until 5 collect i$ vals:=for i:=1 step 1 until 5 collect for j:=1:i product j$ num_fit(vals,{1,x,x**2},x=pts); 2 {14.571428571*X - 61.428571429*X + 54.6,{54.6, - 61.428571429,14.571428571}} </TT></PRE><P>