LU decomposition of rectangular matrices

2019-08-12 07:03发布

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

2条回答
啃猪蹄的小仙女
2楼-- · 2019-08-12 07:45

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.

查看更多
Bombasti
3楼-- · 2019-08-12 07:59

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.

查看更多
登录 后发表回答