HP 50g Graphing Calculator User Manual

Page 631

Advertising
background image

Page 18-64

x VANDERMONDE

Place x in stack, obtain V

n

IF ‘p<n-1’ THEN

This IF is step 3 in algorithm

n

Place n in stack

p 2 +

Calculate p+1

FOR j

Start loop, j = n-1 to p+1, step = -1

j COL

− DROP

Remove column, drop from stack

-1 STEP

Close FOR-STEP loop

ELSE
IF ‘p>n-1’ THEN
n 1 +

Calculate n+1

p 1 +

Calculate p+1

FOR j

Start loop with j = n, n+1, …, p+1.

x j ^

Calculate x

j

, as a list

OBJ

ARRY

Convert list to array

j COL+

Add column to matrix

NEXT

Close FOR-NEXT loop

END

Ends second IF clause.

END

Ends first IF clause. Produces X

y OBJ ARRY

Convert list y to an array

X yv

Enter matrix and array as X and y

«

Open subprogram 3

X yv MTREG

X and y used by program MTREG

NUM

If needed, converts to floating point

b

Resulting vector passed as b

«

Open subprogram 4

b yv

Place b and yv in stack

X b *

Calculate X

b

-

Calculate e = y - X

b

ABS SQ DUP

Calculate SSE, make copy

y

ΣLIST n /

Calculate

⎯y

n 1 LIST SWAP CON

Create vector of n values of

⎯y

yv

− ABS SQ

Calculate SST

/

Calculate SSE/SST

NEG 1 +

Calculate r = [1–SSE/SST ]

1/2

“r” TAG

Tag result as “r”

SWAP

Exchange stack levels 1 and 2

Advertising