Re: [問題] 最小方差解

看板MATLAB作者 (<( ̄︶ ̄)>)時間15年前 (2010/08/10 01:30), 編輯推噓1(1010)
留言11則, 2人參與, 最新討論串2/2 (看更多)

08/08 21:28,
\
08/08 21:28

08/08 21:50,
\是matlab幫你弄好的,不用\ 也可以參考我po的網址來求解
08/08 21:50

08/08 23:06,
doc mldivide裡面有寫吧@___@""
08/08 23:06

08/09 00:36,
預設是用QR分解來解,若考慮到condition number之類的問
08/09 00:36

08/09 00:37,
題,可以查查Householder/Givens該怎麼寫. (Matlab)
08/09 00:37

08/09 23:24,
如果他要求LSM 怎可能是用反矩陣就求解出來
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
應該是constrained linear least-squares problems
08/10 15:08, 2F

08/10 15:08, , 3F
function lsqlin 之類的
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
AX=B A,B是常數矩陣;僅X未知 那應該是我想太複雜了!
08/10 15:19, 9F

08/10 15:19, , 10F
Append 問太簡單的 我還是沒回答吧 !
08/10 15:19, 10F

08/10 15:20, , 11F
有的我做過or我會then我就指引拉!
08/10 15:20, 11F
文章代碼(AID): #1CO3j2EM (MATLAB)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #1CO3j2EM (MATLAB)