最近在linear algebra done right中看到的拟合度比泰勒展开更加高的函数方法
泰勒展开在有限维度(finite-dimension)的情况 距离0点近处才更加准确。
Example:
Find a polynomial u with real coefficients and degree at most 5 that approximates sin(x) as well as possible on the interval [-π,π].
Solution:
1.Let u(x) denotes the approximate function.
Hence, make∫[-π,π] |sin(x)-u(x)|²dx as small as possible
2.Let C[-π,π] denotes the real vector space
with inner product:
v∈C[-π,π] defined by v(x)=sinx;
3.Let U denotes the subspace ofC[-π,π]
u∈U defined by u(x) (the approximate function).
4.To find∫[-π,π] |sin(x)-u(x)|²dxas small as possible is to find ||u(x)-v(x)||:
(Here we make the polynomial or in other word the function be the vector (point in other word).)
We know that u has degree at most 5 degree, consequently there is a basis(1, x ,x^2,x^3,x^4,x^5) of U. From the basis and Gram-Schmidt procedure we can get an orthonormal basis.
so the orthonormal basis(e1,e2,……,e5,e6).
5.Use the orthogonal projection
u(x)=PU(v(x))=
=0.987862x-0.155271x^3+0.00564312x^5.
6.Compared to Taylor series approximation, the Gram-Schmidt has much less error.
Gram-Schmidt :
Taylor series appromation:
ux=x-x^3/3!+x^5/5!