フィルターのクリア

What's the truncation error in SVD?

5 ビュー (過去 30 日間)
Xiaohan Du
Xiaohan Du 2017 年 8 月 30 日
編集済み: Christine Tobler 2017 年 8 月 30 日
Hi all,
I'm trying to prove one thing: perform SVD on matrix a, the truncation error of singular values equals to truncation error of products of singular vectors. Here is the code:
clear; clc;
% PART 1.
% define the matrix a.
a = magic(8);
% define number of singular values left after truncation.
n = 2;
[u, s, v] = svd(a, 0);
% sum all singular values.
ds = diag(s);
dss = sum(ds);
% sum first n singular values
dssn = sum(ds(1:n));
% work out the error after truncation.
dsp = 1 - dssn / dss;
% PART 2
% multiply left singular vectors with singular values
u = u * s;
% select the first n singular vectors, i.e. to truncate
us = u(:, 1:n);
vs = v(:, 1:n);
% reconstruct the solution
ur = us * vs';
% work out the error
up = norm(ur - a, 'fro') / norm(a, 'fro');
I expect dsp = up, but dsp = 0.0431, up = 0.0613, why?

回答 (1 件)

Christine Tobler
Christine Tobler 2017 年 8 月 30 日
編集済み: Christine Tobler 2017 年 8 月 30 日
Use dsp = norm(ds(n+1:end)) / norm(ds) instead of the sum.
This is because in norm(U*S*V', 'fro'), you can move U and V outside of the norm since they are orthogonal, leaving you with norm(S, 'fro'), and since S is diagonal, this is equal to norm(diag(S)).

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by