<s>
Numerical	B-Algorithm
methods	I-Algorithm
for	I-Algorithm
linear	I-Algorithm
least	I-Algorithm
squares	I-Algorithm
entails	O
the	O
numerical	B-General_Concept
analysis	I-General_Concept
of	O
linear	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
problems	O
.	O
</s>
<s>
orthogonal	B-Algorithm
projection	I-Algorithm
onto	O
the	O
image	O
of	O
X	O
.	O
</s>
<s>
is	O
known	O
as	O
the	O
normal	B-Algorithm
equation	I-Algorithm
.	O
</s>
<s>
where	O
X+	O
is	O
the	O
Moore	O
–	O
Penrose	O
pseudoinverse	B-Algorithm
of	O
X	O
.	O
</s>
<s>
Although	O
this	O
equation	O
is	O
correct	O
and	O
can	O
work	O
in	O
many	O
applications	O
,	O
it	O
is	O
not	O
computationally	O
efficient	O
to	O
invert	O
the	O
normal-equations	O
matrix	O
(	O
the	O
Gramian	B-Algorithm
matrix	I-Algorithm
)	O
.	O
</s>
<s>
An	O
exception	O
occurs	O
in	O
numerical	B-Algorithm
smoothing	I-Algorithm
and	I-Algorithm
differentiation	I-Algorithm
where	O
an	O
analytical	O
expression	O
is	O
required	O
.	O
</s>
<s>
If	O
the	O
matrix	O
XTX	O
is	O
well-conditioned	B-Algorithm
and	O
positive	B-Algorithm
definite	I-Algorithm
,	O
implying	O
that	O
it	O
has	O
full	O
rank	O
,	O
the	O
normal	B-Algorithm
equations	I-Algorithm
can	O
be	O
solved	O
directly	O
by	O
using	O
the	O
Cholesky	O
decomposition	O
RTR	O
,	O
where	O
R	O
is	O
an	O
upper	B-Algorithm
triangular	I-Algorithm
matrix	I-Algorithm
,	O
giving	O
:	O
</s>
<s>
Orthogonal	B-Algorithm
decomposition	O
methods	O
of	O
solving	O
the	O
least	O
squares	O
problem	O
are	O
slower	O
than	O
the	O
normal	B-Algorithm
equations	I-Algorithm
method	O
but	O
are	O
more	O
numerically	B-Algorithm
stable	I-Algorithm
because	O
they	O
avoid	O
forming	O
the	O
product	O
XTX	O
.	O
</s>
<s>
The	O
matrix	O
X	O
is	O
subjected	O
to	O
an	O
orthogonal	B-Algorithm
decomposition	O
,	O
e.g.	O
,	O
the	O
QR	O
decomposition	O
as	O
follows	O
.	O
</s>
<s>
where	O
Q	O
is	O
an	O
m×m	O
orthogonal	B-Algorithm
matrix	I-Algorithm
(	O
QTQ	O
=	O
I	O
)	O
and	O
R	O
is	O
an	O
n×n	O
upper	B-Algorithm
triangular	I-Algorithm
matrix	I-Algorithm
with	O
.	O
</s>
<s>
Because	O
Q	O
is	O
orthogonal	B-Algorithm
,	O
the	O
sum	O
of	O
squares	O
of	O
the	O
residuals	O
,	O
s	O
,	O
may	O
be	O
written	O
as	O
:	O
</s>
<s>
These	O
equations	O
are	O
easily	O
solved	O
as	O
R	O
is	O
upper	B-Algorithm
triangular	I-Algorithm
.	O
</s>
<s>
where	O
U	O
is	O
m	O
by	O
m	O
orthogonal	B-Algorithm
matrix	I-Algorithm
,	O
V	O
is	O
n	O
by	O
n	O
orthogonal	B-Algorithm
matrix	I-Algorithm
and	O
is	O
an	O
m	O
by	O
n	O
matrix	O
with	O
all	O
its	O
elements	O
outside	O
of	O
the	O
main	O
diagonal	O
equal	O
to	O
0	O
.	O
</s>
<s>
The	O
pseudoinverse	B-Algorithm
of	O
is	O
easily	O
obtained	O
by	O
inverting	O
its	O
non-zero	O
diagonal	O
elements	O
and	O
transposing	O
.	O
</s>
<s>
Since	O
(	O
the	O
property	O
of	O
pseudoinverse	B-Algorithm
)	O
,	O
the	O
matrix	O
is	O
an	O
orthogonal	B-Algorithm
projection	I-Algorithm
onto	O
the	O
image	O
(	O
column-space	O
)	O
of	O
X	O
.	O
</s>
<s>
In	O
accordance	O
with	O
a	O
general	O
approach	O
described	O
in	O
the	O
introduction	O
above	O
(	O
find	O
XS	O
which	O
is	O
an	O
orthogonal	B-Algorithm
projection	I-Algorithm
)	O
,	O
</s>
<s>
This	O
method	O
is	O
the	O
most	O
computationally	O
intensive	O
,	O
but	O
is	O
particularly	O
useful	O
if	O
the	O
normal	B-Algorithm
equations	I-Algorithm
matrix	O
,	O
XTX	O
,	O
is	O
very	O
ill-conditioned	B-Algorithm
(	O
i.e.	O
</s>
<s>
if	O
its	O
condition	B-Algorithm
number	I-Algorithm
multiplied	O
by	O
the	O
machine	O
's	O
relative	O
round-off	B-Algorithm
error	I-Algorithm
is	O
appreciably	O
large	O
)	O
.	O
</s>
<s>
The	O
numerical	B-Algorithm
methods	I-Algorithm
for	I-Algorithm
linear	I-Algorithm
least	I-Algorithm
squares	I-Algorithm
are	O
important	O
because	O
linear	B-General_Concept
regression	I-General_Concept
models	I-General_Concept
are	O
among	O
the	O
most	O
important	O
types	O
of	O
model	O
,	O
both	O
as	O
formal	O
statistical	O
models	O
and	O
for	O
exploration	O
of	O
data-sets	O
.	O
</s>
<s>
The	O
majority	O
of	O
statistical	O
computer	O
packages	O
contain	O
facilities	O
for	O
regression	O
analysis	O
that	O
make	O
use	O
of	O
linear	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
computations	O
.	O
</s>
<s>
Hence	O
it	O
is	O
appropriate	O
that	O
considerable	O
effort	O
has	O
been	O
devoted	O
to	O
the	O
task	O
of	O
ensuring	O
that	O
these	O
computations	O
are	O
undertaken	O
efficiently	O
and	O
with	O
due	O
regard	O
to	O
round-off	B-Algorithm
error	I-Algorithm
.	O
</s>
<s>
Some	O
of	O
the	O
topics	O
involved	O
in	O
considering	O
numerical	B-Algorithm
methods	I-Algorithm
for	I-Algorithm
linear	I-Algorithm
least	I-Algorithm
squares	I-Algorithm
relate	O
to	O
this	O
point	O
.	O
</s>
<s>
It	O
can	O
therefore	O
be	O
important	O
that	O
considerations	O
of	O
computation	O
efficiency	O
for	O
such	O
problems	O
extend	O
to	O
all	O
of	O
the	O
auxiliary	O
quantities	O
required	O
for	O
such	O
analyses	O
,	O
and	O
are	O
not	O
restricted	O
to	O
the	O
formal	O
solution	O
of	O
the	O
linear	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
problem	O
.	O
</s>
<s>
Matrix	O
calculations	O
,	O
like	O
any	O
other	O
,	O
are	O
affected	O
by	O
rounding	B-Algorithm
errors	I-Algorithm
.	O
</s>
