There is a well known algorithm to determine the singular values of a
nonsquare matrix
, the Singular Value Decomposition (SVD).
, where
and
are orthogonal
resp.
-matrices, i.e.
, which causes
.
is a ``diagonal''
-Matrix; with singular values
in the diagonal (see below), and
Now:
The last equality is true, since we have multiplied by
and
, since
is orthogonal.
So minimizing
is equivalent to minimizing
. Written out in components, this
means minimizing
with |
We now choose
so that
is minimal, or:
In our kind of problem we have
and
To avoid matrices of
size 10000, it would be nice if we could calculate with
and
.
This can be done, especially since
,
and
can be calculated in the following easy way, when moving the sliding window
across the sequences:
Let e.g.
be a window of AAs at position
(i.e. the midpoint of
the window is at position
). Let
be the vector such that
, i.e.
In this case
is the
row of the matrix
Let
be 1 if the AA at position
is part of an
-helix, 0
if the AA at position
is not part of an
-helix.
Starting with a 0-matrix for
, a 0-vector
for
and
we compute for
to
These equations hold, since:
![]() |
|||
![]() |
and
![]() |
|||
![]() |
|||
![]() |
Comparing both results shows the stated identity.
It's much easier to compare
![]() |
with
![]() |
and
![]() |
In the next subsection we'll show a solution to our problem, which requires
and
alone (and does not use
or
We can express
in the following way:
Using the eigenvalue decomposition of
(notice, that
is symmetric!) we see:
, where
is an orthonormal
-matrix, and
is a
diagonal matrix with diagonal-entries (eigenvalues)
and
, hence
Applying again the definition
and hence
, we get:
Now let
, then, since
, it holds:
The minimum of this equation is achieved for the minimum of each quadratic
term, i.e. the derivative of each term with respect to
Let
be a SVD of
. Then
Since
is a diagonal matrix,
with diagonal entries
, it's obvious, that
. So we can conclude, that
and
. In other
words:
, and
is the eigenvector/eigenvalue decomposition of
.
(Remark:
so
is the
eigenvector/eigenvalue decomposition of
. This
means, that if we would need
we would have to compute
. Fortunately this is normally not needed.)
| SVD: |
|
| EV: |
|
| Inserting (*) for
|
leads to
|
![]() |
Compare the interactive exercise ``SVD".
Gaston Gonnet, Institute for Scientific Computing, ETH Zürich, Switzerland