Hilbert Matrix in least squares polynomial regression

5 ビュー (過去 30 日間)
Ali Kiral
Ali Kiral 2021 年 4 月 23 日
編集済み: Ali Kiral 2021 年 4 月 24 日
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

回答 (1 件)

John D'Errico
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]
Invalid use of operator.

Error in connector.internal.fevalMatlab

Error in connector.internal.fevalJSON
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.
  1 件のコメント
Ali Kiral
Ali Kiral 2021 年 4 月 24 日
I am so sorry, I'm editing the matrix A in a few seconds..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeHilbert and Walsh-Hadamard Transforms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by