Hilbert Matrix in least squares polynomial regression
5 ビュー (過去 30 日間)
古いコメントを表示
When approximating the polynomial x^2+3x+2 with a least squares polynomial of degree two in [0 1], the coefficient matrix of the resultant linear system is a 3x3 Hilbert Matrix. Vector b is as follows as generated by the approximation problem. I should get an approximating polynomial almost like the original one, but the coefficients are quite afar from 2, 3 and 1. I know Hilbert Matrices are ill-conditioned. What can I do? (I am using where n is the degree of the approximating polynomial, is the function to be approximated and )
A=[1 1/2 1/3;1/2 1/3 1/4;1/3 1/4 1/5];
b=[16/3; 9/4; 97/60];
A\b
ans =
15.5000
-51.000
46.000
0 件のコメント
回答 (1 件)
John D'Errico
2021 年 4 月 23 日
編集済み: John D'Errico
2021 年 4 月 23 日
Is A really a hilbert matrix? LOOK CAREFULLY AT WHAT YOU WRITE!!!!!!!!!
In fact, A is not even a valid 3x3 matrix. If you fail to show valid syntax, is there a way we can realistically help you? How do we know what you tried?
A=[1 1/2 1/3;1/2 1/3 1/4;1/^1/4 1/5]
This is a 3x3 hilbert matrix.
hilb(3)
ans =
1 0.5 0.33333
0.5 0.33333 0.25
0.33333 0.25 0.2
Is a 3x3 hilbert matrix truly ill-conditioned?
cond(hilb(3))
ans =
524.06
No.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!