One problem arises when a function is given explicitly, but we wish to find a “ simpler ” type of function, such as a polynomial, that can be used to determine approximate values of the given function. The other problem in approximation theory is considered with fitting functions to given data and finding the “ best ” function in a certain class to represent the data. To find a function in a certain class to represent the given data best relative to some measure. A better approach would be to find the “best” ( in some sense) approaching curve, even if it does not agree precisely with the data at any point The study of approximation theory involves two general types of problems: Gaoal of Chapter 4
x y T P151 Fig. 4.1
least squares 最小二乘 ; root mean square(rms) 均方根 ; normal equations 正则方程组 ; deviation 偏差 ; residual 残差,留数 ; Useful Words 4.1 Least- Square Line Problem: Given data, where the abscissas are distinct, determine a formula that relates these variables. Finding a best function means in some sense to minimize one of the errors Maximum error Everage error Root-mean-square error See Eq. ( ) (P152)
Formula used for fitting curve 1.Straight line f(x)=Ax+B sec , Page Polynomial, sec , P168 3.Power curve, sec , P156 4.Exponential curve, sec. 4.2 P160
* * * The minimax approach To minimize The average approach To minimize The least squares approach To minimize · Determine a best line approximation using the given data I) The linear least squares polynomial · · · *
To minimize The normal equations See Eq. ( ) (P154)
Determine a best approximation using the given data such that is minimal. Example Find the least squares line to approximate the data given in the given table. The normal equations II) The least squares polynomial of degree M (M >1) * * * · k xkxk ykyk
See Subsection 4.2.6(P168)
Example Fit the data in the table with the discrete least squares polynomial of degree 2. Using normal equations produces Solving the system gives Hence k xkxk ykyk
Determine an linear-squares power function using the given data III) Power fit Minimize Let Then See Subsection 4.1.2(P156) Example See Figure 4.1 (page 151).
Method I Find directly using the least-squares technique. Determine a least-squares exponential function using the given data IV) Transformations for data linearization Let The error function E(A,C) is It’s a system of nonlinear equations. Eq ( page 163 ) See Subsection 4.2.2(P162) We have
Method II Transformations for data linearization Let Then, to find is to find the least-squares line 1. Tansform into which is denoted by 2. Find the normal equations with unkowns 3. Let 4. Write out See Table 4.6 ( page 166 ) Determine a least-squares exponential function using the given data (Note that ) Subsection (P160)
piecewise-linear 4.3 Interpolation by Spline Functions 样条函数 Find piecewice interpolating polynomial with smoothness enough.
Definition Let, and the nodes are given. If is a cubic function on each subinterval with some properties, then is called the cubic spline function. There are 4N constants need to be determined. Since is a polynomial with degree of 3, the degree of its 2 nd derivative is only 1. Let
Integrate twice : Rewrite it as Evaluate at and Note that and We have Then
Derivative Evaluate at Denote Then Replace k by k-1 in Evaluate at
give only N-1 equations with N+1 unkowns
See 4.65, Page 180
Natural boundary: Endpoint constaints are introduced. (See Table 4.8, Page 179) Lemma 4.2, Page 180
and are specifed. clamped boundary: Lemma 4.1, Page 180
Cubic spline for
For each of the different endpoint conditions, there is a particular tridiagonal system of linear equations