International Association of Scientific Innovation and Research (IASIR) (An Association Unifying the Sciences, Engineering, and Applied Research) International Journal of Emerging Technologies in Computational and Applied Sciences (IJETCAS) www.iasir.net ISSN (Print): 79-7 ISSN (Online): 79- On a New Weighted Average Interpolation Vignesh Pai B H and Hamsapriye B.Tech. 7 th Semester Student, Department of Mechanical engineering, R V College of Engineering, R.V. Vidyaniketan post, Mysore Road, Bangalore- 9, INDIA. Professor, Department of Mathematics, R V College of Engineering, R.V. Vidyaniketan post, Mysore Road, Bangalore- 9, INDIA. Abstract: A new interpolation technique called the Weighted Average Interpolation (WAI) is discussed. A new concept named the effect is explained, for both even and odd number of points, along with associated correction factors. The procedure of deriving the formula is discussed in detail, under different cases. These ideas are also extended to extrapolation of data. The relation between the WAI and Lagrange s interpolation formula is analyzed. Further, the advantages and disadvantages of the WAI with reference to the Lagrange s formula are examined. Numerical examples are worked out for clarity. Keywords: Weighted Average Interpolation, Effect, Odd points, Even points, Correction factor, Pascal s triangle. I. Introduction Interpolation is a technique of constructing new data points, based on the existing data points obtained by sampling or experimentation. It is often required to estimate the values at intermediate points. The well-known Lagrange method of interpolation is such that, the number of arithmetic operations increase rapidly, whenever the number of data points is increased. This is a limitation and therefore there is a need to reduce the number or operations without compromising on the accuracy. The new method discussed herein overcomes this limitation and thus the number of operations are significantly reduced. Further, the formulae are derived based on logical reasoning. The method is simple compared to other methods. II. The Concept of Positive and Negative Effect in Interpolation Let (, ) be an intermediate point between two points (, ) and (, ). The Lagrange s interpolation formula [] is given by This formula can be rewritten in the form as. (). () We see that is the weighted average of and and the weights are observed to be ratios of distances. We set a reference distance as d(, ) = ( - ). The weight associated with is the ratio of the reference distance and d(, ). Similarly, the weight associated with is the ratio of the reference distance with itself. Refer Figure. Figure : The concept of Effect IJETCAS - 8;, IJETCAS All Rights Reserved Page 9
From figure we can rewrite equation () as. () The above expression can be recast into a different form, by using the concept of Effect. This effect is defined as the ratio of the reference distance with either d(, ) or d(, ). The effect of (, ) on (, ) is the ratio and the effect of (, ) on (, ) is. Thus, equation () takes the form () The reference distance can as well be d(, ). In fact, the reference distance can be taken to be unity. In this case the formula () can be written as () The concept of effect can be extended to many number of points. Taking the reference distance to be unity, we can similarly write the weighted average formula for n points (, ), (, ),, (, ) as () Initially, we have considered the effects of the n points on the interpolating point (, ) with positive signs, which may not be correct. Figure explains the possible negative effects clearly. Figure : Negative effect of even points. Sequence Sequence Sequence Sequence Sequence Sequence Sequence Sequence Consider the point (., ). The idea of interpolation is to fit a smooth curve passing through the given points. If the given data points are (, ), (, ), (, ), (, ) then = for.. Suppose the point (, ) is changed to (, ) then the point (., ) slides down below. Similarly, if the point (, ) is changed to (, ) then the point (., ) again slides below =. If simultaneously the two points (, ) and (, ) are varied to (, ) and IJETCAS - 8;, IJETCAS All Rights Reserved Page 7
(, ), then the effect piles-up and the effect is clearly visible, as shown in figure, as sequence. If (., ) is the reference point, then (, ) (on the right) and (, ) (on the left) are defined to be odd points. Also, (, ) (on the right) and (, ) (on the left) are defined to be even points. Therefore, the observation is that whenever the value of even points increases, the interpolated value decreases. For the same reference point (., ) and for the same data points, if the point (, ) is changed to (, ) then the point (., ) increases above. Similarly, if the point (, ) is changed to (, ) then the point (., ) again increases above. If simultaneously the two points (, ) and (, ) are changed to (, ) and (, ), then the effect piles-up and the effect is clearly visible, as shown in figure, as sequence. Therefore, the observation is that whenever the value of even points decreases, the interpolated value increases. In a nut-shell, we say that the even points ( odd points ) exert a negative effect ( positive effect ) on the point to be interpolated. It is to be noted from equation () that the immediate points or the first points or the odd points exert positive effect. With all these observations the formula for interpolation can be modified to be, (7) whenever four data points are given. Formula (7) is true when (, ) lies between (, ) and (, ). Extending these ideas we can obtain the formula for eight points to be (8) for < <. The formula for any general case would have alternate signs. III. Correction Factors At this stage we have only considered the effects, without their magnitudes. Incorporating these magnitudes leads us to the correction factors. As an illustration we consider the below data. Sl. no. Table I: Data Points. 8 7 9 8 Let the point of interpolation be (9, ). Equation (8) takes the form, (9) where =.87, =., =., =, =, =., =. and =.87 are the weights. The estimated y = 7.7, whereas the exact value is 8. The Lagrange s interpolation gives the exact value 8. We now compare with the coefficients of Lagrange s interpolation formula, written in the form as. () Here =., =.9, =.9, =.98, =.98, =.9, =.9 and =.. On comparing the weights with the above coefficients, we impose the following condition that any two weight ratios must equal the corresponding coefficient ratios. That is, IJETCAS - 8;, IJETCAS All Rights Reserved Page 7
Since the ratio is important and not their individual values, we may equate the numerators and denominators separately. Thus we obtain and. In the above example, =.7898, =.989, =.88879, =.98, =.98, =.88879, =.989 and =.7898. Now if we use the weights s we obtain y = 8.The advantage is that these correction factors can be computed just once, irrespective of the interval in which (, ) lies. Also these weights are independent of the function that is interpolated. These correction factors rectify the end result obtained from the formula (9), in such a way that the final result coincides with that of the Lagrange s. The weights are not actually the coefficients of the ordinates in WAI formula. For instance, the coefficient of in WAI formula is This is compared with c of Lagrange interpolation. It is to be remarked that in the weighted average interpolation, we are just interested in the relative importance of the given s with reference to each other. This simplifies the computations to a greater extent. It is found that these correction factors can be obtained from the Pascal s triangle. Since their ratios are of importance, dividing all of them by the smallest, we obtain the correction factors to be =, = 7, =, =, =, =, = 7 and =. Thus, the correction factors for n points are obtained from the n th line of the Pascal s triangle. The formula with correction factors for points: (, ), (, ), (, ), (, ) is tabulated below Table : List of formulae to be used for points. Interval Formula to be used to to to IV. Extrapolation Using Weighted Average Method We extend the idea of weighted average interpolation to extrapolation as well. Initially, few virtual intervals are created beyond the given range. Suppose that (, ), (, ) and (, ) are the given points. If < <, then the interpolation formula is () and if < < the interpolation formula is () Suppose < <. Then we are extrapolating on the right. We include a virtual interval (, ) and use the interpolation ideas, as explained in earlier sections. For instance, consider =, = and =. For < < 8, we include the virtual interval (, 8). Using the ideas discussed in the earlier sections, the extrapolation formula can be written in the form as () IJETCAS - 8;, IJETCAS All Rights Reserved Page 7
It is observed that (, ) is an odd point, which therefore exerts positive effect on (, ). Similarly, if 8 < <, then the extrapolation formula in the virtual interval (8, ) is () It is to be noted that (, ) is an even point, which now exerts a negative effect on (, ). This pattern continues for every additional virtual interval. It is also observed that there is absolutely no difference between the expressions () and (), except that the numerator and the denominator both are multiplied by. Therefore there is exactly one formula for extrapolation. Similar ideas are used while extrapolating on the left. V. A Comparative Study of Lagrange Interpolation and WAI In this section we shall confirm that the end results of WAI and Lagrange s interpolation coincide. Let us consider three data points. If (, ) lies between the first two data points, the WAI formula is () The Lagrange s interpolation formula is Suppose the points are equally spaced, then equation () simplifies to and formula (7) simplifies to () (7) Dividing equation (8) throughout by and multiplying by two we obtain (8) This is the numerator of the WAI formula. Also, it is easily proved that (9) Therefore equation (9) reduces to (). These ideas can be easily generalized to any number of points. VI. Unequally Spaced Points The above study is based on equally spaced points. The extension of these ideas to unequally spaced points is a tedious task. Nevertheless, unequally spaced points, following a pattern is of special interest. Therefore, we have considered three such cases, as stated below: ) Unequally spaced points, whose consecutive differences are in geometric progression (UGP) ) Unequally spaced points placed in harmonic progression (UHP) ) Unequally spaced points, whose consecutive differences are in arithmatic progression (UAP) ) UGP: As an illustration, we fix the common ratio r =. The correction factors can be computed on similar lines as in the case of equally spaced points. Let the data points be a + s, a + s r, a + s r. The correction factors are found to be =, = and =, which can be viewed as, and. Again, with four data points, the correction factors are,, and and with data points the correction factors are given to be,,, and. In general, for n points and for any r, we can compute,,, The p s follow the special pattern close to the Pascal s triangle as given below. () IJETCAS - 8;, IJETCAS All Rights Reserved Page 7
Table : s for points in UGP for. POINT POINTS POINTS POINTS 7 7 POINTS POINTS 7 POINTS 9 8 POINTS 7 7 8 8 7 7 9 POINTS 79 97 787 97 79 POINTS 788 977 977 788 The pattern for the s is explained as follows. The fourth line consists of the numbers, 7, 7 and. The fifth line is computed as,,, and. So, in general, if the numbers in the th line is,,,,,, then the ( +) th line can be computed to be,,,,...,. The s for any in UGP is tabulated below: Table : s for points in UGP for any. POINT POINTS POINTS POINTS POINTS POINTS So, in general, if the numbers in the th line is,,,,,, then the ( +) th line can be computed to be,,,,...,. ) UHP: We consider a general harmonic progression in the form,,. The correction factors can be computed on similar lines as in the case of equally spaced points. The correction factors are computed in table. Table : List of Correction factors for points in UHP. POINT POINTS POINTS POINTS 7 POINTS POINTS 8 8 9 7 POINTS 9 8 87 87 8 POINTS 8 9 87 97977 8 9 POINTS 97 87 7 9 777 7899 POINTS 9 987 88 97977 8789 The pattern for the corrections factors in the n th line is given to be ) UAP: The general form of the sequence in this case is considered to be a, a+d, a+ d, a+ d, a+ d, The correction factors for the above choice of values is tabulated below. Table : List of Correction factors for points in UAP. POINT POINTS POINTS POINTS 9 POINTS 8 7 POINTS 9 7 9 7 POINTS 97 7 8 POINTS 9 7 7 77 9 POINTS 8 POINTS 8 9 999 8 7 IJETCAS - 8;, IJETCAS All Rights Reserved Page 7
If the numbers in the th line are,,,, n =, then the corrections factors in the ( +) th line can be computed to be,,,...,. VII. Error Analysis In section V, we have shown that the end results of Lagrange interpolation and the WAI methods are equal. Hence the error estimate of WAI coincides with that of Lagrange s method. Thus the error term in the WAI is estimated to be []: is a polynomial of degree. VIII. Advantages and Disadvantages The major advantage of WAI over Lagrange interpolation is that fewer arithmetic operations are required. As an illustration, with eight data points, it can be easily verified that WAI and Lagrange interpolation requires 7 and 8 distinct arithmetic operations, respectively. In general, with n points WAI performs n distinct arithmetic operations, whereas Lagrange interpolation performs n n arithmetic operations. Remarkably, it is possible to obtain a polynomial approximation in Lagrange interpolation, whereas this is difficult in the case of WAI. This is a disadvantage. IX. Numerical Examples In this section, we have worked out an example under UGP. The following data points,,,,, and satisfy the function. The problem is to estimate at. For these four data points the correction factors are,,,,,, and or,,,,,, and. () Plugging in these correction factors in the WAI formula and for we arrive at () Thus.778which is the same value as Lagrange interpolation, whereas the actual value is.799. X. Conclusions A new interpolation technique called the Weighted Average Interpolation (WAI) has been discussed. A new concept called effect has been introduced, for both odd and even number of points, along with the respective correction factors. Also, the procedure of deriving the formula has been discussed in a greater detail, under different cases. Further, these ideas have been extended to extrapolation of data. Furthermore, the relation between the WAI and Lagrange interpolation formula has been studied. The merits and demerits of the WAI and the Lagrange s interpolation have also been explained. Finally, several illustrations and numerical examples are worked out for clarity. References [] Kendall E. Atkinson, An Introduction to Numerical Analysis, nd Edition, John Wiley & sons, 988. IJETCAS - 8;, IJETCAS All Rights Reserved Page 7