首页 > 其他 > 详细

SVD: The solution of Ax=b (updated)

时间:2014-03-27 06:38:12      阅读:453      评论:0      收藏:0      [点我收藏+]

 

The solution of Ax=b

A is matrix whose size is m-by-n, b is a n-by-1 column vector. The solution x is a n-by-1 column vector

 

Mldivide is a matlab function, which is also denoted as"\". It solve systems of linear equations Ax = B for x. The method is called left divide.

bubuko.com,布布扣, The A-1 is on the left of b, this is the reason called left divide. But the A-1 exists only when A is a square matrix. When A is not a square matrix, we must apply SVD method to solve this equation. This is how "\" works in matlab.

bubuko.com,布布扣

bubuko.com,布布扣

[m,n] = size(U); U is a column orthogonal matrix

[n,n] = size(s); S is a diagonal matrix

[n,n] = size(V); V is an orthogonal matrix

 

U is a column orthogonal matrix, which means the multiplication of the same column is 1, while the multiplication of different columns is, just likes the following equation:

bubuko.com,布布扣

E is the unit matrix, whose size is n-by-n.

So, we can deduct:

bubuko.com,布布扣

S is a diagonal matrix, so S-1 is diagonal as well. Each diagonal element of S-1 is the multiplicative inverse number of the corresponding diagonal element of S.

bubuko.com,布布扣

E is the unit matrix, whose size is n-by-n.

So, we can continue deduct:

bubuko.com,布布扣

The size of UTb is n-by-1. We have to stick to the right order of computing.

V is an orthogonal matrix, so

bubuko.com,布布扣

We can get:

bubuko.com,布布扣

VS-1 can be calculated first, since both of them are square matrixs.

The solution of bubuko.com,布布扣 is bubuko.com,布布扣.

 

When A is matrix whose size is m-by-n, B is a n-by-k matrix. The solution X is a n-by-k matrix

bubuko.com,布布扣

Solve k equations : bubuko.com,布布扣 using the method above. Each column xi consist the solution X.

 

The matlab code is:

1
2
[U,S,V]=svd(A); % Singular valure compsition
x = V/S*(U‘*b);

 The above code equals to: 

x=A/b

SVD: The solution of Ax=b (updated),布布扣,bubuko.com

SVD: The solution of Ax=b (updated)

原文:http://www.cnblogs.com/chaseskyline/p/3626918.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!