Why does the polyfit() function in Matlab use Vandermonde-matrix and QR factorization method to solve a system of equations?
7 ビュー (過去 30 日間)
古いコメントを表示
The polyfit() function in Matlab can be used for least-squares curve fit for any given polynomial order. The method used by Matlab is to construct the Vandermonde matrix and then solve it via QR factorization.
However, why doesn't Matlab use a more direct method for solving a system of linear equations using the conditions for least-squares fit and matrix-inversion methods such as Gauss-eliminaton?
0 件のコメント
採用された回答
Jan
2012 年 11 月 9 日
The Gauss-elimiation works also, but the QR factorization is more stable here. I do not think that the method you sugeest is "more direct".
3 件のコメント
Jan
2012 年 11 月 10 日
編集済み: Jan
2012 年 11 月 10 日
"Numerically stable" means that small variations of the input do not cause large changes of the output caused by rounding errors. See http://en.wikipedia.org/wiki/Numerical_stability.
Standard examples for a numerically instable method is creating the inverse of A to solve the linear system A*x=b or the simple sum:
sum([1, 1e17, -1e17]) % replies 0
sum([1e17, -1e17, 1]) % replies 1
This means, that the the sum critically depends on the order of input elements.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Polynomials についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!