HP F2226A - 48GII Graphic Calculator User Manual page 630

Graphing calculator
Table of Contents

Advertisement

If p = n-1, X = V
.
n
If p < n-1, then remove columns p+2, ..., n-1, n from V
If p > n-1, then add columns n+1, ..., p-1, p+1, to V
In step 3 from this list, we have to be aware that column i (i= n+1, n+2, ...,
i
p+1) is the vector [x
x
1
2
rather than a vector, i.e., x = { x
i
i
i
sequence { x
x
... x
1
2
n
use the COL menu to add those columns to the matrix V
After X is ready, and having the vector y available, the calculation of the
coefficient vector b is the same as in multiple linear fitting (the previous matrix
application). Thus, we can write a program to calculate the polynomial fitting
that can take advantage of the program already developed for multiple linear
fitting. We need to add to this program the steps 1 through 3 listed above.
The algorithm for the program, therefore, can be written as follows:
Enter vectors x and y, of the same dimension, as lists. (Note: since the
function VANDERMONDE uses a list as input, it is more convenient to enter
the (x,y) data as a list.) Also, enter the value of p.
Determine n = size of vector x.
Use the function VANDERMONDE to generate the Vandermonde
matrix V
for the list x entered.
n
If p = n-1, then
X = V
,
n
Else If p < n-1
Remove columns p+2, ..., n from V
(Use a FOR loop and COL-)
Else
Add columns n+1, ..., p+1 to V
(FOR loop, calculate x
Convert y to vector
Calculate b using program MTREG (see example on multiple linear
fitting above)
i
i
... x
]. If we were to use a list of data values for x
n
x
... x
}, we can easily calculate the
1
2
n
}. Then, we can transform this list into a vector and
i
, convert to vector, use COL+)
to form X.
n
to form matrix X.
n
until X is completed.
n
to form X
n
to form X
n
Page 18-59

Advertisement

Table of Contents
loading

This manual is also suitable for:

48gii

Table of Contents