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 CenterFile Exchange에서 Hilbert 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