Re: [問題] 最小方差解
推
08/08 21:28,
08/08 21:28
→
08/08 21:50,
08/08 21:50
推
08/08 23:06,
08/08 23:06
推
08/09 00:36,
08/09 00:36
→
08/09 00:37,
08/09 00:37
→
08/09 23:24,
08/09 23:24
→
08/09 23:24,
08/09 23:24
雖然確實不能算是反矩陣...不過就是這樣喔。=P
首先是解法。"/" (也就是mldivide)
mldivide at MATLAB Documentation
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/mldivide.html
Least Squares Solutions
If the equation Ax = b does not have a solution (and A is not a square
matrix), x = A\b returns a least squares solution — in other words, a
solution that minimizes the length of the vector Ax - b, which is equal to
norm(A*x - b). See Example 3 for an example of this.
.
.
.
If A is not square, then Householder reflections are used to compute an
orthogonal-triangular factorization.
A*P = Q*R
where P is a permutation, Q is orthogonal and R is upper triangular (see qr).
The least squares solution X is computed with X = P*(R\(Q'*B))
Least Squares Solutions at Wolfram Mathworld
http://ppt.cc/sJAV
A general way to find a least squares solution to an overdetermined system is
to use a singular value decomposition to form a matrix that is known as the
pseudo-inverse of a matrix. In Mathematica this is computed with
PseudoInverse. This technique works even if the input matrix is rank
deficient. The basis of the technique is given below.
好這樣應該夠了。
有興趣的話,
Moore-Penrose Matrix Inverse at Wolfram Mathworld
http://ppt.cc/PhR~
順便說,MATLAB Documentation建議,
解這個問題的時候盡量不要生出inverse(喔當然這裡是pseudo-inverse),
而是直接用"\"。
A frequent misuse of inv arises when solving the system of linear equations.
One way to solve this is with x = inv(A)*b.
A better way, from both an execution time and numerical accuracy standpoint,
is to use the matrix division operator x = A\b.
----
另外,如果是我們真的誤解了的話,請放心的說出來。...
以上。=)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.71.211.169
推
08/10 15:07, , 1F
08/10 15:07, 1F
→
08/10 15:08, , 2F
08/10 15:08, 2F
→
08/10 15:08, , 3F
08/10 15:08, 3F
→
08/10 15:09, , 4F
08/10 15:09, 4F
→
08/10 15:11, , 5F
08/10 15:11, 5F
→
08/10 15:13, , 6F
08/10 15:13, 6F
→
08/10 15:15, , 7F
08/10 15:15, 7F
→
08/10 15:17, , 8F
08/10 15:17, 8F
→
08/10 15:19, , 9F
08/10 15:19, 9F
→
08/10 15:19, , 10F
08/10 15:19, 10F
→
08/10 15:20, , 11F
08/10 15:20, 11F
討論串 (同標題文章)