HP 50g User Manual Page 631

Graphing calculator.

x VANDERMONDE
IF 'p<n-1' THEN
n
p 2 +
FOR j
j COL DROP
-1 STEP
ELSE
IF 'p>n-1' THEN
n 1 +
p 1 +
FOR j
x j ^
OBJ
j COL+
NEXT
END
END
y OBJ
ARRY
X yv
«
X yv MTREG
NUM
b
«
b yv
X b *
-
ABS SQ DUP
y
LIST n /
n 1
LIST SWAP CON
yv
ABS SQ
/
NEG 1 +
"r"
TAG
SWAP
ARRY
Place x in stack, obtain V
This IF is step 3 in algorithm
Place n in stack
Calculate p+1
Start loop, j = n-1 to p+1, step = -1
Remove column, drop from stack
Close FOR-STEP loop
Calculate n+1
Calculate p+1
Start loop with j = n, n+1, ..., p+1.
j
Calculate x
, as a list
Convert list to array
Add column to matrix
Close FOR-NEXT loop
Ends second IF clause.
Ends first IF clause. Produces X
Convert list y to an array
Enter matrix and array as X and y
Open subprogram 3
X and y used by program MTREG
If needed, converts to floating point
Resulting vector passed as b
Open subprogram 4
Place b and yv in stack
Calculate X b
Calculate e = y - X b
Calculate SSE, make copy
Calculate y
Create vector of n values of y
Calculate SST
Calculate SSE/SST
Calculate r = [1–SSE/SST ]
Tag result as "r"
Exchange stack levels 1 and 2
n
1/2
Page 18-64  