# Polynomial Fitting, - HP F2226A - 48GII Graphic Calculator User Manual

Graphing calculator.

You should have in your calculator's stack the value of the matrix X and the
vector b, the fitted values of y are obtained from y = X⋅b, thus, just press *
to obtain: [5.63.., 8.25.., 5.03.., 8.23.., 9.45..].
Compare these fitted values with the original data as shown in the table
below:
x
1
1.20
2.50
3.50
4.00
6.00
Polynomial fitting
Consider the x-y data set {(x
to fit a polynomial or order p to this data set. In other words, we seek a fitting
⋅x + b
of the form y = b
+ b
0
1
least-square approximation to the values of the coefficients b = [b
], by putting together the matrix X
b
... b
3
p
_
1
x
1
1
x
2
1
x
3
.
.
.
.
1
x
n
_
Then, the vector of coefficients is obtained from b = (X
the vector y = [y
y
... y
1
2
In Chapter 10, we defined the Vandermonde matrix corresponding to a
vector x = [x
] . The Vandermonde matrix is similar to the matrix X
x
... x
1
2
m
of interest to the polynomial fitting, but having only n, rather than (p+1)
columns.
We can take advantage of the VANDERMONDE function to create the matrix
X if we observe the following rules:
x
x
y
2
3
3.10
2.00
5.70
3.10
2.50
8.20
4.50
2.50
5.00
4.50
3.00
8.20
5.00
3.50
9.50
,y
), (x
,y
), ..., (x
,y
1
1
2
2
n
2
3
⋅x
⋅x
+ b
+ ... + b
2
3
2
3
x
x
...
1
1
2
3
x
x
...
2
2
2
3
x
x
...
3
3
.
.
.
.
.
2
3
x
x
...
n
n
T
]
.
n
y-fitted
5.63
8.25
5.03
8.23
9.45
)}. Suppose that we want
n
p
⋅x
. You can obtain the
p
b
0
1
_
p-1
p
x
y
1
1
p-1
p
x
y
2
2
p-1
p
x
y
3
3
.
.
.
.
p-1
p
x
y
n
n
_
T
⋅X)
-1
⋅X
T
⋅y, where y is
Page 18-58
b
2