Try   HackMD

Least squares problem

Problem

Let

A=[11121314] and b=[1122].

Find

xR2 such that
Axb
is minimized.

Thought

Givne any

m×n matrix
A
, we know

Col(A)={Ax:xRn}

is the set of all possible

Ax. Let
V=Col(A)
. The projection
w=projV(b)
is the unique point on
V
with the shortest distance to
b
. Thus, we may solve
Ax=w
instead. By the projection formula, we have

Ax=w=A(AA)1Ab,

so we may choose

x=(AA)1Ab.

Sample answer

The projection of

b onto the column space
Col(A)
is
w=(AA)1Ab
. Since
Ax=b
has no solution, we solve
Ax=w
instead, which means
x=(AA)1Ab
.

The rest is the computation. Now we have

x=(AA)1Ab=[4101030]1[11111234][1122]=[0.50.4].

We could try that

Ax=[0.91.31.72.1]

and

Axb2=0.12+0.32+0.32+0.12=0.2, which seems to be a promising answer.

This note can be found at Course website > Learning resources.