注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Silence的博客

大师只有一个

 
 
 

日志

 
 

pinvMoore-Penrose pseudoinverse of matrix  

2008-10-28 11:12:17|  分类: 技术 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

pinvMoore-Penrose pseudoinverse of matrix

      Syntax
   B = pinv(A)B = pinv(A,tol)DefinitionThe Moore-Penrose pseudoinverse is a matrix B of
the same dimensions as A' satisfying four conditions:A*B*A = A
B*A*B = B
A*B is Hermitian
B*A is HermitianThe computation is based on svd(A) and any singular
values less than tol are treated as zero.DescriptionB = pinv(A) returns the Moore-Penrose
pseudoinverse of A. B = pinv(A,tol) returns the Moore-Penrose
pseudoinverse and overrides the default tolerance, max(size(A))*norm(A)*eps.ExamplesIf A is square and not singular, then pinv(A) is
an expensive way to compute inv(A). If A is
not square, or is square and singular, then inv(A) does
not exist. In these cases, pinv(A) has some of, but not
all, the properties of inv(A). If A has more rows than columns and is not of full
rank, then the overdetermined least squares problemminimize norm(A*x-b) does not have a unique solution. Two of the infinitely many solutions
are x = pinv(A)*b and y = A\b These two are distinguished by the facts that norm(x) is
smaller than the norm of any other solution and that y has
the fewest possible nonzero components. For example, the matrix generated by A = magic(8); A = A(:,1:6) is an 8-by-6 matrix that happens to have rank(A) = 3. A =
    64     2     3    61    60     6
     9    55    54    12    13    51
    17    47    46    20    21    43
    40    26    27    37    36    30
    32    34    35    29    28    38
    41    23    22    44    45    19
    49    15    14    52    53    11
     8    58    59     5     4    62 The right-hand side is b = 260*ones(8,1), b =
     260
     260
     260
     260
     260
     260
     260
     260The scale factor 260 is the 8-by-8 magic sum. With all eight columns,
one solution to A*x = b would be a vector of all 1's.
With only six columns, the equations are still consistent, so a solution exists,
but it is not all 1's. Since the matrix is rank deficient,
there are infinitely many solutions. Two of them arex = pinv(A)*b which isx =
    1.1538
    1.4615
    1.3846
    1.3846
    1.4615
    1.1538andy = A\bwhich produces this result.Warning: Rank deficient, rank = 3  tol =   1.8829e-013.
y =
    4.0000
    5.0000
         0
         0
         0
   -1.0000Both of these are exact solutions in the sense that norm(A*x-b) and norm(A*y-b) are on the order of roundoff error. The solution x is
special because norm(x) = 3.2817 is smaller than the norm of any other solution, including norm(y) = 6.4807 On the other hand, the solution y is special because
it has only three nonzero components.

  评论这张
 
阅读(724)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017