通过 Gram-Schmidt 正交化过程 求逼近函数

来源:互联网 发布:php数组查询重复 编辑:程序博客网 时间:2024/05/22 03:54

最近在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:<f,g>=∫[-π,π][f(x)g(x)dx]dx

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 anorthonormal basis.



so the orthonormal basis(e1,e2,……,e5,e6).


5.Use the orthogonal projection

u(x)=PU(v(x))=<v,e1>e1+……+<v,e6>e6

=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!




阅读全文
1 0