Section 12: Calculating with Matrices 159

Silas' deliveries were:

 

 

Week

 

 

1

2

3

 

 

 

 

Cabbage (kg)

186

141

215

Broccoli (kg)

88

92

116

Calculating the Residual

The HP-15C enables you to calculate the residual, that is, the matrix

Residual = R–YX

where R is the result matrix and X and Y are the matrices specified in the X- and Y-registers.

This capability is useful, for example, in doing iterative refinement on the solution of a system of equations and for linear regression problems. For example, if C is a possible solution for AX = B, then B – AC indicates how well this solution satisfies the equation. (Refer to the HP-15C Advanced Functions Handbook for information about iterative refinement and linear regression.)

The residual function (> 6) uses the current contents of the result matrix and the matrices specified in the X- and Y-registers to calculate the residual defined above. The residual is stored in the result matrix, replacing the original result matrix. A matrix specified in the X- or Y-register can not be the result matrix.

Using > 6 rather than * and - gives a result with improved accuracy, particularly if the residual is small compared to the matrices being subtracted.

To calculate the residual:

1.Enter the descriptor of the Y matrix into the Y-register.

2.Enter the descriptor of the X matrix into the X-register.

3.Designate the R matrix as the result matrix.

4.Press ´>6. The residual replaces the original result matrix (R). The descriptor of the result matrix is placed in the X- register.

Page 159
Image 159
HP 15c Scientific manual Calculating the Residual, Week Cabbage kg 186 141 215 Broccoli kg 116