# Least-square Solution (function Lsq) - HP F2226A - 48GII Graphic Calculator User Manual

Graphing calculator.

Press ` to return to the numerical solver environment. To check that the
solution is correct, try the following:
Press ——, to highlight the A: field.
Press L @CALC@ `, to copy matrix A onto the stack.
Press ˜ ˜@CALC@ `, to copy solution vector X onto the stack.
In ALG mode, the stack will now look like this:
Let's store the latest result in a variable X, and the matrix into variable A, as
follows:
Press K~x` to store the solution vector into variable X
Press ƒ ƒ ƒ to clear three levels of the stack
Press K~a` to store the matrix into variable A
Now, let's verify the solution by using: @@@A@@@ * @@@X@@@ `, which results in
the vector [8.6917... -3.4109... -1.1301...], which is not equal to [15 5 22],
the original vector b. The "solution" is simply the point that is closest to the
three lines represented by the three equations in the system, and not an exact
solution.

## Least-square solution (function LSQ)

The LSQ function returns the minimum-norm least-square solution of a linear
system Ax = b, according to the following criteria:
Page 11-23