Polynomial Fit

Polynomial of Degree [ ] calculates polynomial equations from labeled or unlabeled two-column data matrices. The result is a polynomial of the specified degree that is the best fit to the data in the least-squares sense. For the polynomial fit, the x column appears first.

To find the best fit by a polynomial of second degree to the set of points

$\displaystyle \left(\vphantom{ 0,.64}\right.$0,.64$\displaystyle \left.\vphantom{ 0,.64}\right)$,$\displaystyle \left(\vphantom{ .5,.09}\right.$.5,.09$\displaystyle \left.\vphantom{ .5,.09}\right)$,$\displaystyle \left(\vphantom{ 1,.04}\right.$1,.04$\displaystyle \left.\vphantom{ 1,.04}\right)$,$\displaystyle \left(\vphantom{
1.5,.49}\right.$1.5,.49$\displaystyle \left.\vphantom{
1.5,.49}\right)$,$\displaystyle \left(\vphantom{ 2,1.44}\right.$2, 1.44$\displaystyle \left.\vphantom{ 2,1.44}\right)$

first remove the parentheses and convert the entries into a two-column matrix. To make this conversion, place the insertion point in the list; from the Matrices submenu, choose Reshape; then specify two columns.

$\blacktriangleright$ Matrices + Reshape

0,.64,.5,.09, 1,.04, 1.5,.49, 2, 1.44, $\left[\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1 & 0.04 \\
1.5 & 0.49 \\
2 & 1.44
\end{array}
}\right.$$\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1 & 0.04 \\
1.5 & 0.49 \\
2 & 1.44
\end{array}$$\left.\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1 & 0.04 \\
1.5 & 0.49 \\
2 & 1.44
\end{array}
}\right]$

To find the parabola that best fits the data, make the following choices.

$\blacktriangleright$ Statistics + Fit Curve to Data

Select Polynomial of Degree [ ], enter UserInput2, click OK

$\left[\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}
}\right.$$\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}$$\left.\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}
}\right]$, Polynomial fit: y = .64 - 1.6x + 1.0x2 


$\left[\vphantom{
\begin{array}{rr}
x & y \\
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}
}\right.$$\begin{array}{rr}
x & y \\
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}$$\left.\vphantom{
\begin{array}{rr}
x & y \\
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}
}\right]$, Polynomial fit: y = 5.9971 - 8.5243x + 2.2786x2

You can plot the points and polynomial on the same graph. You will notice that these points were chosen such that they lie on the parabola.

$\blacktriangleright$ Plot 2D + Rectangular

$\left[\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}
}\right.$$\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}$$\left.\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 0.04 \\
1.5 & 0.49 \\
2.0 & 1.44
\end{array}
}\right]$,.64 - 1.6x + 1.0x2

dtbpF2.9992in1.9995in0ptPlot

$\blacktriangleright$ Plot 2D + Rectangular

$\left[\vphantom{
\begin{array}{rr}
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}
}\right.$$\begin{array}{rr}
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}$$\left.\vphantom{
\begin{array}{rr}
0 & 6 \\
1 & .1 \\
2 & -3 \\
3 & 2 \\
4 & 8
\end{array}
}\right]$, 5.9971 - 8.5243x + 2.2786x2

dtbpF3in2.0003in0pt

You can also fit data with polynomials of higher degree.

$\blacktriangleright$ Statistics + Fit Curve to Data

Select Polynomial of Degree [ ], enter UserInput3, click OK

$\left[\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 8.04 \\
1.5 & 0.49 \\
2.0 & -7.44
\end{array}
}\right.$$\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 8.04 \\
1.5 & 0.49 \\
2.0 & -7.44
\end{array}$$\left.\vphantom{
\begin{array}{cc}
0 & 0.64 \\
0.5 & 0.09 \\
1.0 & 8.04 \\
1.5 & 0.49 \\
2.0 & -7.44
\end{array}
}\right]$, Polynomial fit: y = 8.1143×10-2 +1.4114x + 9.1143x2 -5.92x3

dtbpF2.9992in1.9995in0ptPlot

$\blacktriangleright$ Statistics + Fit Curve to Data,

Select Polynomial of Degree [ ], enter UserInput4, click OK

$\left[\vphantom{
\begin{array}{cc}
1 & 12 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
9 & 18
\end{array}
}\right.$$\begin{array}{cc}
1 & 12 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
9 & 18
\end{array}$$\left.\vphantom{
\begin{array}{cc}
1 & 12 \\
3 & 4 \\
5 & 6 \\
7 & 8 \\
9 & 18
\end{array}
}\right]$, Polynomial fit: y = ${\frac{{1779}}{{64}}}$ - ${\frac{{529}}{{24}}}$x + ${\frac{{229}}{{32}%
}}$x2 - ${\frac{{23}}{{24}}}$x3 + ${\frac{{3}}{{64}}}$x4

dtbpF3in2.0003in0pt