<s>
In	O
applied	O
statistics	O
,	O
total	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
is	O
a	O
type	O
of	O
errors-in-variables	B-Algorithm
regression	I-Algorithm
,	O
a	O
least	B-Algorithm
squares	I-Algorithm
data	O
modeling	O
technique	O
in	O
which	O
observational	O
errors	O
on	O
both	O
dependent	O
and	O
independent	O
variables	O
are	O
taken	O
into	O
account	O
.	O
</s>
<s>
It	O
is	O
a	O
generalization	O
of	O
Deming	B-Algorithm
regression	I-Algorithm
and	O
also	O
of	O
orthogonal	O
regression	O
,	O
and	O
can	O
be	O
applied	O
to	O
both	O
linear	O
and	O
non-linear	O
models	O
.	O
</s>
<s>
The	O
total	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
approximation	O
of	O
the	O
data	O
is	O
generically	O
equivalent	O
to	O
the	O
best	O
,	O
in	O
the	O
Frobenius	O
norm	O
,	O
low-rank	O
approximation	O
of	O
the	O
data	O
matrix	O
.	O
</s>
<s>
In	O
the	O
least	B-Algorithm
squares	I-Algorithm
method	I-Algorithm
of	O
data	O
modeling	O
,	O
the	O
objective	O
function	O
,	O
S	O
,	O
</s>
<s>
where	O
is	O
the	O
augmented	B-Algorithm
matrix	I-Algorithm
with	O
E	O
and	O
F	O
side	O
by	O
side	O
and	O
is	O
the	O
Frobenius	O
norm	O
,	O
the	O
square	O
root	O
of	O
the	O
sum	O
of	O
the	O
squares	O
of	O
all	O
entries	O
in	O
a	O
matrix	O
and	O
so	O
equivalently	O
the	O
square	O
root	O
of	O
the	O
sum	O
of	O
squares	O
of	O
the	O
lengths	O
of	O
the	O
rows	O
or	O
columns	O
of	O
the	O
matrix	O
.	O
</s>
<s>
The	O
goal	O
is	O
then	O
to	O
find	O
that	O
reduces	O
the	O
rank	O
of	O
by	O
k	O
.	O
Define	O
to	O
be	O
the	O
singular	O
value	O
decomposition	O
of	O
the	O
augmented	B-Algorithm
matrix	I-Algorithm
.	O
</s>
<s>
A	O
naive	O
GNU	B-Language
Octave	I-Language
implementation	O
of	O
this	O
is	O
:	O
</s>
<s>
All	O
modern	O
implementations	O
based	O
,	O
for	O
example	O
,	O
on	O
solving	O
a	O
sequence	O
of	O
ordinary	O
least	B-Algorithm
squares	I-Algorithm
problems	I-Algorithm
,	O
approximate	O
the	O
matrix	O
(	O
denoted	O
in	O
the	O
literature	O
)	O
,	O
as	O
introduced	O
by	O
Van	O
Huffel	O
and	O
Vandewalle	O
.	O
</s>
<s>
In	O
total	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
a	O
residual	O
represents	O
the	O
distance	O
between	O
a	O
data	O
point	O
and	O
the	O
fitted	O
curve	O
measured	O
along	O
some	O
direction	O
.	O
</s>
<s>
One	O
approach	O
is	O
to	O
normalize	O
by	O
known	O
(	O
or	O
estimated	O
)	O
measurement	O
precision	O
thereby	O
minimizing	O
the	O
Mahalanobis	O
distance	O
from	O
the	O
points	O
to	O
the	O
line	O
,	O
providing	O
a	O
maximum-likelihood	O
solution	O
;	O
the	O
unknown	O
precisions	O
could	O
be	O
found	O
via	O
analysis	B-General_Concept
of	I-General_Concept
variance	I-General_Concept
.	O
</s>
<s>
In	O
short	O
,	O
total	B-Algorithm
least	I-Algorithm
squares	I-Algorithm
does	O
not	O
have	O
the	O
property	O
of	O
units-invariancei.e.	O
</s>
