开发者

LU decomposition of rectangular matrices

开发者 https://www.devze.com 2023-01-07 01:39 出处:网络
Method lu of package Matrix works fine for square matrices. However, I can\'t see why there is that square开发者_JS百科 restriction. How can I perform LU decomposition on a rectangular matrix?You can

Method lu of package Matrix works fine for square matrices. However, I can't see why there is that square开发者_JS百科 restriction. How can I perform LU decomposition on a rectangular matrix?


You can embed it into a identity matrix:

[ a11 a12 a13 ]
[ a21 a22 a23 ]
[  0   0   1  ]

LU decomposition is for square matrices only. You may want to check Wikipedia for a refreshing.


Non-square matricies mean different things.

If it has more rows than columns (more equations than unknowns), it means you need a least squares approximation. You can pre-multiply both sides by the transpose of A and use LU decomp on that. The result is the least squares "best" solution.

If it has fewer rows than columns (more unknowns than equations), you need Singular Value Decomposition (SVD). It'll give you the best solution and the null space as well.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号