Interpolation Observations Calculations Continuous Data Analytics Functions Analytic Solutions

Total Page:16

File Type:pdf, Size:1020Kb

Interpolation Observations Calculations Continuous Data Analytics Functions Analytic Solutions Data types in science Discrete data (data tables) Experiment Interpolation Observations Calculations Continuous data Analytics functions Analytic solutions 1 2 From continuous to discrete … From discrete to continuous? ?? soon after hurricane Isabel (September 2003) 3 4 If you think that the data values f in the data table What do we want from discrete sets i are free from errors, of data? then interpolation lets you find an approximate 5 value for the function f(x) at any point x within the Data points interval x1...xn. 4 Quite often we need to know function values at 3 any arbitrary point x y(x) 2 Can we generate values 1 for any x between x1 and xn from a data table? 0 0123456 x 5 6 1 Key point!!! Applications of approximating functions The idea of interpolation is to select a function g(x) such that Data points 1. g(xi)=fi for each data 4 point i 2. this function is a good 3 approximation for any interpolation differentiation integration other x between y(x) 2 original data points 1 0123456 x 7 8 What is a good approximation? Important to remember What can we consider as Interpolation ≡ Approximation a good approximation to There is no exact and unique solution the original data if we do The actual function is NOT known and CANNOT not know the original be determined from the tabular data. function? Data points may be interpolated by an infinite number of functions 9 10 Step 1: selecting a function g(x) Two step procedure We should have a guideline to select a Select a function g(x) reasonable function g(x). We need some ideas about data!!! Find coefficients g(x) may have some standard form or be specific for the problem 11 12 2 Linear combination is the most common Some ideas for selecting g(x) form of g(x) & linear combination of elementary functions, or Most interpolation methods trigonometric, or exponential functions, or are grounded on rational functions, … ‘smoothness’of g(x) a h (x) a h (x) a h (x) ... interpolated functions. = 1 1 + 2 2 + 3 3 + However, it does not work all the time Three of most common approximating functions & Polynomials Practical approach, i.e. & Trigonometric functions what physics lies beneath & Exponential functions the data 13 14 Approximating functions should have following properties Linear Interpolation: Idea & It should be easy to determine & It should be easy to evaluate & It should be easy to differentiate & It should be easy to integrate 15 16 Example: C++ Linear Interpolation: coefficients double int1(double x, double xi[], double yi[], int imax) { double y; int j; // if x is ouside the xi[] interval if (x <= xi[0]) return y = yi[0]; if (x >= xi[imax-1]) return y = yi[imax-1]; // loop to find j so that x[j-1] < x < x[j] j = 0; while (j <= imax-1) { if (xi[j] >= x) break; j = j + 1; } y = yi[j-1]+(yi[j]-yi[j-1])*(x-xi[j-1])/(xi[j]-xi[j-1]); return y; } 17 18 bisection approach is much more efficient to search an array 3 Linear interpolation: conclusions 1.0 The linear interpolation may work well for very smooth functions when the second and higher derivatives are 0.5 small. It is worthwhile to note that for the each data interval ) 2 0.0 one has a different set of coefficients a0 and a1. sin(x This is the principal difference from data fitting where -0.5 the same function, with the same coefficients, is used f(x)=sin(x2) Data points to fit the data points on the whole interval [x1,xn]. linear interpolation -1.0 We may improve quality of linear interpolation by increasing number of data points x on the interval. 0123 i x HOWEVER!!! It is much better to use higher-odrder 19 interpolations. 20 Linear vs. Quadratic interpolations Polynomial Interpolation example from F.S.Acton “Numerical methods that work” “A table of sin(x) covering the first quadrant, for example, requires 541 pages if it is to be linearly interpolable to eight decimal places. If quadratic interpolation is used, the same table takes only one page having entries at one-degree intervals.” The number of data points minus one defines the order of interpolation. Thus, linear (or two-point interpolation) is the first order interpolation 21 22 Properties of polynomials System of equations for the second order Weierstrass theorem: If f(x) is a continuous function in the closed interval a ≤ x ≤ b then for every ε > 0 there exists a polynomial Pn(x), where the value on n depends on the value of ε , such that for all x in the closed interval a ≤ x ≤ b Ö We need three points for the second order interpolation Pn (x) − f (x) < ε Ö Freedom to choose points? Ö This system can be solved analytically 23 24 4 Lagrange Interpolation: C++ Solutions for the second order double polint(double x, double xi[], double yi[], int isize, int npoints) { double lambda[isize]; double y; int j, is, il; // check order of interpolation if (npoints > isize) npoints = isize; and any arbitrary order (Lagrange interpolation) // if x is ouside the xi[] interval if (x <= xi[0]) return y = yi[0]; if (x >= xi[isize-1]) return y = yi[isize-1]; f (x) ≈ f1λ1(x) + f2λ2 (x) + fnλn (x) K // loop to find j so that x[j-1] < x < x[j] n x − x j = 0; (x) j λi = ∏ while (j <= isize-1) j(≠i)=1 xi − x j { if (xi[j] >= x) break; j = j + 1; 25 } 26 Example: C++ (cont.) 2.5 // shift j to correspond to (npoint-1)th interpolation f(x) j = j - npoints/2; 2.0 data points 1-st order // if j is ouside of the range [0, ... isize-1] 1.5 3-rd order if (j < 0) j=0; 5-th order ] if (j+npoints-1 > isize-1 ) j=isize-npoints; 2 1.0 7-th order y = 0.0; for (is = j; is <= j+npoints-1; is = is+1) 0.5 { 0.0 lambda[is] = 1.0; for (il = j; il <= j+ npoints-1; il = il + 1) -0.5 { cos(3x)/[0.4+(x-2) -1.0 if(il != is) lambda[is] = lambda[is]* (x-xi[il])/(xi[is]-xi[il]); -1.5 } y = y + yi[is]*lambda[is]; -2.0 } 0123 return y; x } 27 28 note on Lagrange interpolation Important! It is possible to use Lagrange formula Moving from the first -order to the third and 5th order straightforwardly, like in the example above improves interpolated values to the original function. However, the 7th order interpolation instead being There is a better algorithm - Neville’s algorithm closer to the function f(x) produces wild oscillations. (for constructing the same interpolating This situation is not uncommon for high-order polynomial) polynomial interpolation. Sometimes Neville’s algorithm confused with Rule of thumb: do not use high order interpolation. Aitken’s algorithm Fifth order may be considered as a practical limit. (the latter now considered obsolete). If you believe that the accuracy of the 5th order interpolation is not sufficient for you, then you should rather consider some other method of interpolation. 29 30 5 Cubic Spline Spline vs. Polynomials Ö The idea of spline interpolation is reminiscent of very old mechanical devices used by draftsmen to Ö One of the principal drawbacks of the polynomial get a smooth shape. interpolation is related to discontinuity of derivatives at Ö It is like securing a strip of elastic material (metal data points xj. or plastic ruler) between knots (or nails). Ö The procedure for deriving coefficients of spline Ö The final shape is quite smooth. interpolations uses information from all data points, Ö Cubic spline interpolation is used in most plotting i.e. nonlocal information to guarantee global smoothness software. (cubic spline gives most smooth result) in the interpolated function up to some order of derivatives. 31 32 Equations Coefficients for spline interpolation the interpolated function on [xj,xj+1] interval is presented in a cubic spline form For the each interval we need to have a set of three parameters bj, cj and dj. Since there are (n-1) intervals, one has to have 3n-3 equations for deriving the coefficients for j=1,n-1. What is different from polynomial interpolation? The fact that gj(xj)=fj(xj) imposes (n-1) equations. … the way we are looking for the coefficients! Polynomial interpolation: 3 coefficient for 4 data points Spline interpolation: 3 coefficients for the each interval 33 34 Central idea to spline interpolation Now we have more equations (n-1) + 2(n-2) = 3n-5 equations the interpolated function g(x) has continuous the first Data points and second derivatives at each of the n-2 interior 4 points xj. 3 Data points 4 y(x) 2 3 1 y(x) 2 0123456 but we need 3n-3 equations x 1 0123456 x 35 36 6 a little math … Cubic spline boundary conditions c d s (x) = a + b (x − x ) + i (x − x )2 + i (x − x )3 (1) i i i i 2 i 6 i Possibilities to fix two more conditions xi−1 ≤ x ≤ xi i = 1,2,KN. Need to find ai , bi , ci , di . • Natural spline - the second order derivatives are d s '(x) = b + c (x − x ) + i (x − x )2 zero on boundaries. i i i i 2 i • Input values for the first order f(1)(x) derivates at si ''(x) = ci + di (x − xi ) boundaries si '''(x) = di • Input values for the second order f(2)(x) derivates at by the definition (interpolation) a = f (x ) boundaries i i 1) s(x) must be continuous at xi si (xi ) = si+1(xi ) c d a = a + b (x − x ) + i+1 (x − x )2 + i+1 (x − x )3 i i+1 i+1 i i+1 2 i i+1 6 i i+1 37 38 The system of equations to find coefficients hidi = ci − ci−1 i = 1,2,KN c0 = cN = 0 (5) using hi = xi − xi−1 2 2 3 hi hi hi hici − di = bi − bi−1 i = 2,3,KN (6) hibi − ci + di = fi − fi−1 (2) 2 2 6 2 3 hi hi 2) si '(xi ) = si+1'(xi ) i = 1,2,KN −1 h b − c + d = f − f i = 1,2, N (7) i i 2 i 6 i i i−1 K d c h − i h2 = b − b i = 2,3, N (3) Solve the system for c i = 1,2, N −1 i i 2 i i i−1 K i K Consider two equations (7) for points i and i −1 3) si ''(xi ) = si+1''(xi ) 2 hi hi fi − fi−1 dihi = ci − ci−1 i = 2,3,KN (4) b = c + d = i 2 i 6 i h additional equations (conditions at the ends) i h h2 f f s''(a) = s''(b) = 0 i−1 i−1 i−1 − i−2 bi−1 = ci−1 + di−1 = 2 6 hi−1 s1''(x0 ) = 0, sN ''(xN ) = 0 c1 − d1h1 = 0, cN = 0 and sustract the second equation from the first 1 1 f − f f − f b b (h c h c ) (h2d h2 d ) i i−1 i−1 i−2 39 i − i−1 = i i − i−1 i−1 − i i − i−1 i−1 + − 40 2 6 hi hi−1 Use the difference bi − bi−1 in the right side of (6) h2 2h2 ⎛ f − f f − f ⎞ h c + h c − i−1 d − i d = 2⎜ i i−1 − i−1 i−2 ⎟ (8) i i i−1 i−1 i−1 i ⎜ ⎟ Implementation 2 3 ⎝ hi hi−1 ⎠ Then from (5) 2 Recommendation – do not write your own hi di = hi (ci − ci−1), 2 spline program but get one from ….
Recommended publications
  • Generalized Barycentric Coordinates on Irregular Polygons
    Generalized Barycentric Coordinates on Irregular Polygons Mark Meyery Haeyoung Leez Alan Barry Mathieu Desbrunyz Caltech - USC y z Abstract In this paper we present an easy computation of a generalized form of barycentric coordinates for irregular, convex n-sided polygons. Triangular barycentric coordinates have had many classical applications in computer graphics, from texture mapping to ray-tracing. Our new equations preserve many of the familiar properties of the triangular barycentric coordinates with an equally simple calculation, contrary to previous formulations. We illustrate the properties and behavior of these new generalized barycentric coordinates through several example applications. 1 Introduction The classical equations to compute triangular barycentric coordinates have been known by mathematicians for centuries. These equations have been heavily used by the earliest computer graphics researchers and have allowed many useful applications including function interpolation, surface smoothing, simulation and ray intersection tests. Due to their linear accuracy, barycentric coordinates can also be found extensively in the finite element literature [Wac75]. (a) (b) (c) (d) Figure 1: (a) Smooth color blending using barycentric coordinates for regular polygons [LD89], (b) Smooth color blending using our generalization to arbitrary polygons, (c) Smooth parameterization of an arbitrary mesh using our new formula which ensures non-negative coefficients. (d) Smooth position interpolation over an arbitrary convex polygon (S-patch of depth 1). Despite the potential benefits, however, it has not been obvious how to generalize barycentric coordinates from triangles to n-sided poly- gons. Several formulations have been proposed, but most had their own weaknesses. Important properties were lost from the triangular barycentric formulation, which interfered with uses of the previous generalized forms [PP93, Flo97].
    [Show full text]
  • Mathematical Construction of Interpolation and Extrapolation Function by Taylor Polynomials Arxiv:2002.11438V1 [Math.NA] 26 Fe
    Mathematical Construction of Interpolation and Extrapolation Function by Taylor Polynomials Nijat Shukurov Department of Engineering Physics, Ankara University, Ankara, Turkey E-mail: [email protected] , [email protected] Abstract: In this present paper, I propose a derivation of unified interpolation and extrapolation function that predicts new values inside and outside the given range by expanding direct Taylor series on the middle point of given data set. Mathemati- cal construction of experimental model derived in general form. Trigonometric and Power functions adopted as test functions in the development of the vital aspects in numerical experiments. Experimental model was interpolated and extrapolated on data set that generated by test functions. The results of the numerical experiments which predicted by derived model compared with analytical values. KEYWORDS: Polynomial Interpolation, Extrapolation, Taylor Series, Expansion arXiv:2002.11438v1 [math.NA] 26 Feb 2020 1 1 Introduction In scientific experiments or engineering applications, collected data are usually discrete in most cases and physical meaning is likely unpredictable. To estimate the outcomes and to understand the phenomena analytically controllable functions are desirable. In the mathematical field of nu- merical analysis those type of functions are called as interpolation and extrapolation functions. Interpolation serves as the prediction tool within range of given discrete set, unlike interpola- tion, extrapolation functions designed to predict values out of the range of given data set. In this scientific paper, direct Taylor expansion is suggested as a instrument which estimates or approximates a new points inside and outside the range by known individual values. Taylor se- ries is one of most beautiful analogies in mathematics, which make it possible to rewrite every smooth function as a infinite series of Taylor polynomials.
    [Show full text]
  • On Multivariate Interpolation
    On Multivariate Interpolation Peter J. Olver† School of Mathematics University of Minnesota Minneapolis, MN 55455 U.S.A. [email protected] http://www.math.umn.edu/∼olver Abstract. A new approach to interpolation theory for functions of several variables is proposed. We develop a multivariate divided difference calculus based on the theory of non-commutative quasi-determinants. In addition, intriguing explicit formulae that connect the classical finite difference interpolation coefficients for univariate curves with multivariate interpolation coefficients for higher dimensional submanifolds are established. † Supported in part by NSF Grant DMS 11–08894. April 6, 2016 1 1. Introduction. Interpolation theory for functions of a single variable has a long and distinguished his- tory, dating back to Newton’s fundamental interpolation formula and the classical calculus of finite differences, [7, 47, 58, 64]. Standard numerical approximations to derivatives and many numerical integration methods for differential equations are based on the finite dif- ference calculus. However, historically, no comparable calculus was developed for functions of more than one variable. If one looks up multivariate interpolation in the classical books, one is essentially restricted to rectangular, or, slightly more generally, separable grids, over which the formulae are a simple adaptation of the univariate divided difference calculus. See [19] for historical details. Starting with G. Birkhoff, [2] (who was, coincidentally, my thesis advisor), recent years have seen a renewed level of interest in multivariate interpolation among both pure and applied researchers; see [18] for a fairly recent survey containing an extensive bibli- ography. De Boor and Ron, [8, 12, 13], and Sauer and Xu, [61, 10, 65], have systemati- cally studied the polynomial case.
    [Show full text]
  • Easy Way to Find Multivariate Interpolation
    IJETST- Vol.||04||Issue||05||Pages 5189-5193||May||ISSN 2348-9480 2017 International Journal of Emerging Trends in Science and Technology IC Value: 76.89 (Index Copernicus) Impact Factor: 4.219 DOI: https://dx.doi.org/10.18535/ijetst/v4i5.11 Easy way to Find Multivariate Interpolation Author Yimesgen Mehari Faculty of Natural and Computational Science, Department of Mathematics Adigrat University, Ethiopia Email: [email protected] Abstract We derive explicit interpolation formula using non-singular vandermonde matrix for constructing multi dimensional function which interpolates at a set of distinct abscissas. We also provide examples to show how the formula is used in practices. Introduction Engineers and scientists commonly assume that past and currently. But there is no theoretical relationships between variables in physical difficulty in setting up a frame work for problem can be approximately reproduced from discussing interpolation of multivariate function f data given by the problem. The ultimate goal whose values are known.[1] might be to determine the values at intermediate Interpolation function of more than one variable points, to approximate the integral or to simply has become increasingly important in the past few give a smooth or continuous representation of the years. These days, application ranges over many variables in the problem different field of pure and applied mathematics. Interpolation is the method of estimating unknown For example interpolation finds applications in the values with the help of given set of observations. numerical integrations of differential equations, According to Theile Interpolation is, “The art of topography, and the computer aided geometric reading between the lines of the table” and design of cars, ships, airplanes.[1] According to W.M.
    [Show full text]
  • Math 541 - Numerical Analysis Interpolation and Polynomial Approximation — Piecewise Polynomial Approximation; Cubic Splines
    Polynomial Interpolation Cubic Splines Cubic Splines... Math 541 - Numerical Analysis Interpolation and Polynomial Approximation — Piecewise Polynomial Approximation; Cubic Splines Joseph M. Mahaffy, [email protected] Department of Mathematics and Statistics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 92182-7720 http://jmahaffy.sdsu.edu Spring 2018 Piecewise Poly. Approx.; Cubic Splines — Joseph M. Mahaffy, [email protected] (1/48) Polynomial Interpolation Cubic Splines Cubic Splines... Outline 1 Polynomial Interpolation Checking the Roadmap Undesirable Side-effects New Ideas... 2 Cubic Splines Introduction Building the Spline Segments Associated Linear Systems 3 Cubic Splines... Error Bound Solving the Linear Systems Piecewise Poly. Approx.; Cubic Splines — Joseph M. Mahaffy, [email protected] (2/48) Polynomial Interpolation Checking the Roadmap Cubic Splines Undesirable Side-effects Cubic Splines... New Ideas... An n-degree polynomial passing through n + 1 points Polynomial Interpolation Construct a polynomial passing through the points (x0,f(x0)), (x1,f(x1)), (x2,f(x2)), ... , (xN ,f(xn)). Define Ln,k(x), the Lagrange coefficients: n x − xi x − x0 x − xk−1 x − xk+1 x − xn Ln,k(x)= = ··· · ··· , Y xk − xi xk − x0 xk − xk−1 xk − xk+1 xk − xn i=0, i=6 k which have the properties Ln,k(xk) = 1; Ln,k(xi)=0, for all i 6= k. Piecewise Poly. Approx.; Cubic Splines — Joseph M. Mahaffy, [email protected] (3/48) Polynomial Interpolation Checking the Roadmap Cubic Splines Undesirable Side-effects Cubic Splines... New Ideas... The nth Lagrange Interpolating Polynomial We use Ln,k(x), k =0,...,n as building blocks for the Lagrange interpolating polynomial: n P (x)= f(x )L (x), X k n,k k=0 which has the property P (xi)= f(xi), for all i =0, .
    [Show full text]
  • Spatial Interpolation Methods
    Page | 0 of 0 SPATIAL INTERPOLATION METHODS 2018 Page | 1 of 1 1. Introduction Spatial interpolation is the procedure to predict the value of attributes at unobserved points within a study region using existing observations (Waters, 1989). Lam (1983) definition of spatial interpolation is “given a set of spatial data either in the form of discrete points or for subareas, find the function that will best represent the whole surface and that will predict values at points or for other subareas”. Predicting the values of a variable at points outside the region covered by existing observations is called extrapolation (Burrough and McDonnell, 1998). All spatial interpolation methods can be used to generate an extrapolation (Li and Heap 2008). Spatial Interpolation is the process of using points with known values to estimate values at other points. Through Spatial Interpolation, We can estimate the precipitation value at a location with no recorded data by using known precipitation readings at nearby weather stations. Rationale behind spatial interpolation is the observation that points close together in space are more likely to have similar values than points far apart (Tobler’s Law of Geography). Spatial Interpolation covers a variety of method including trend surface models, thiessen polygons, kernel density estimation, inverse distance weighted, splines, and Kriging. Spatial Interpolation requires two basic inputs: · Sample Points · Spatial Interpolation Method Sample Points Sample Points are points with known values. Sample points provide the data necessary for the development of interpolator for spatial interpolation. The number and distribution of sample points can greatly influence the accuracy of spatial interpolation.
    [Show full text]
  • Comparison of Gap Interpolation Methodologies for Water Level Time Series Using Perl/Pdl
    Revista de Matematica:´ Teor´ıa y Aplicaciones 2005 12(1 & 2) : 157–164 cimpa – ucr – ccss issn: 1409-2433 comparison of gap interpolation methodologies for water level time series using perl/pdl Aimee Mostella∗ Alexey Sadovksi† Scott Duff‡ Patrick Michaud§ Philippe Tissot¶ Carl Steidleyk Received/Recibido: 13 Feb 2004 Abstract Extensive time series of measurements are often essential to evaluate long term changes and averages such as tidal datums and sea level rises. As such, gaps in time series data restrict the type and extent of modeling and research which may be accomplished. The Texas A&M University Corpus Christi Division of Nearshore Research (TAMUCC-DNR) has developed and compared various methods based on forward and backward linear regression to interpolate gaps in time series of water level data. We have developed a software system that retrieves actual and harmonic water level data based upon user provided parameters. The actual water level data is searched for missing data points and the location of these gaps are recorded. Forward and backward linear regression are applied in relation to the location of missing data or gaps in the remaining data. After this process is complete, one of three combinations of the forward and backward regression is used to fit the results. Finally, the harmonic component is added back into the newly supplemented time series and the results are graphed. The software created to implement this process of linear regression is written in Perl along with a Perl module called PDL (Perl Data Language). Generally, this process has demonstrated excellent results in filling gaps in our water level time series.
    [Show full text]
  • CS 450 – Numerical Analysis Chapter 7: Interpolation =1[2]
    CS 450 { Numerical Analysis Chapter 7: Interpolation y Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign [email protected] January 28, 2019 yLecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80 2 Interpolation 3 Interpolation I Basic interpolation problem: for given data (t1; y1); (t2; y2);::: (tm; ym) with t1 < t2 < ··· < tm determine function f : R ! R such that f (ti ) = yi ; i = 1;:::; m I f is interpolating function, or interpolant, for given data I Additional data might be prescribed, such as slope of interpolant at given points I Additional constraints might be imposed, such as smoothness, monotonicity, or convexity of interpolant I f could be function of more than one variable, but we will consider only one-dimensional case 4 Purposes for Interpolation I Plotting smooth curve through discrete data points I Reading between lines of table I Differentiating or integrating tabular data I Quick and easy evaluation of mathematical function I Replacing complicated function by simple one 5 Interpolation vs Approximation I By definition, interpolating function fits given data points exactly I Interpolation is inappropriate if data points subject to significant errors I It is usually preferable to smooth noisy data, for example by least squares approximation I Approximation is also more appropriate for special function libraries 6 Issues in Interpolation
    [Show full text]
  • Bayesian Interpolation of Unequally Spaced Time Series
    Bayesian interpolation of unequally spaced time series Luis E. Nieto-Barajas and Tapen Sinha Department of Statistics and Department of Actuarial Sciences, ITAM, Mexico [email protected] and [email protected] Abstract A comparative analysis of time series is not feasible if the observation times are different. Not even a simple dispersion diagram is possible. In this article we propose a Gaussian process model to interpolate an unequally spaced time series and produce predictions for equally spaced observation times. The dependence between two obser- vations is assumed a function of the time differences. The novelty of the proposal relies on parametrizing the correlation function in terms of Weibull and Log-logistic survival functions. We further allow the correlation to be positive or negative. Inference on the model is made under a Bayesian approach and interpolation is done via the posterior predictive conditional distributions given the closest m observed times. Performance of the model is illustrated via a simulation study as well as with real data sets of temperature and CO2 observed over 800,000 years before the present. Key words: Bayesian inference, EPICA, Gaussian process, kriging, survival functions. 1 Introduction The majority of the literature on time series analysis assumes that the variable of interest, say Xt, is observed on a regular or equally spaced sequence of times, say t 2 f1; 2;:::g (e.g. Box et al. 2004; Chatfield 1989). Often, time series are observed at uneven times. Unequally spaced (also called unevenly or irregularly spaced) time series data occur naturally in many fields. For instance, natural disasters, such as earthquakes, floods and volcanic eruptions, occur at uneven intervals.
    [Show full text]
  • Multivariate Lagrange Interpolation 1 Introduction 2 Polynomial
    Alex Lewis Final Project Multivariate Lagrange Interpolation Abstract. Explain how the standard linear Lagrange interpolation can be generalized to construct a formula that interpolates a set of points in . We will also provide examples to show how the formula is used in practice. 1 Introduction Interpolation is a fundamental topic in Numerical Analysis. It is the practice of creating a function that fits a finite sampled data set. These sampled values can be used to construct an interpolant, which must fit the interpolated function at each date point. 2 Polynomial Interpolation “The Problem of determining a polynomial of degree one that passes through the distinct points and is the same as approximating a function for which and by means of a first degree polynomial interpolating, or agreeing with, the values of f at the given points. We define the functions and , And then define We can generalize this concept of linear interpolation and consider a polynomial of degree n that passes through n+1 points. In this case we can construct, for each , a function with the property that when and . To satisfy for each requires that the numerator of contains the term To satisfy , the denominator of must be equal to this term evaluated at . Thus, This is called the Th Lagrange Interpolating Polynomial The polynomial is given once again as, Example 1 If and , then is the polynomial that agrees with at , and ; that is, 3 Multivariate Interpolation First we define a function be an -variable multinomial function of degree . In other words, the , could, in our case be ; in this case it would be a 3 variable function of some degree .
    [Show full text]
  • Interpolation, Extrapolation, Etc
    Interpolation, extrapolation, etc. Prof. Ramin Zabih http://cs100r.cs.cornell.edu Administrivia Assignment 5 is out, due Wednesday A6 is likely to involve dogs again Monday sections are now optional – Will be extended office hours/tutorial Prelim 2 is Thursday – Coverage through today – Gurmeet will do a review tomorrow 2 Hillclimbing is usually slow m Lines with Lines with errors < 30 errors < 40 b 3 Extrapolation Suppose you only know the values of the distance function f(1), f(2), f(3), f(4) – What is f(5)? This problem is called extrapolation – Figuring out a value outside the range where you have data – The process is quite prone to error – For the particular case of temporal data, extrapolation is called prediction – If you have a good model, this can work well 4 Interpolation Suppose you only know the values of the distance function f(1), f(2), f(3), f(4) – What is f(2.5)? This problem is called interpolation – Figuring out a value inside the range where you have data • But at a point where you don’t have data – Less error-prone than extrapolation Still requires some kind of model – Otherwise, crazy things could happen between the data points that you know 5 Analyzing noisy temporal data Suppose that your data is temporal – Radar tracking of airplanes, or DJIA There are 3 things you might wish to do – Prediction: given data through time T, figure out what will happen at time T+1 – Estimation: given data through time T, figure out what actually happened at time T • Sometimes called filtering – Smoothing: given data through
    [Show full text]
  • Lecture 19 Polynomial and Spline Interpolation
    Lecture 19 Polynomial and Spline Interpolation A Chemical Reaction In a chemical reaction the concentration level y of the product at time t was measured every half hour. The following results were found: t 0 .5 1.0 1.5 2.0 y 0 .19 .26 .29 .31 We can input this data into Matlab as t1 = 0:.5:2 y1 = [ 0 .19 .26 .29 .31 ] and plot the data with plot(t1,y1) Matlab automatically connects the data with line segments, so the graph has corners. What if we want a smoother graph? Try plot(t1,y1,'*') which will produce just asterisks at the data points. Next click on Tools, then click on the Basic Fitting option. This should produce a small window with several fitting options. Begin clicking them one at a time, clicking them off before clicking the next. Which ones produce a good-looking fit? You should note that the spline, the shape-preserving interpolant, and the 4th degree polynomial produce very good curves. The others do not. Polynomial Interpolation n Suppose we have n data points f(xi; yi)gi=1. A interpolant is a function f(x) such that yi = f(xi) for i = 1; : : : ; n. The most general polynomial with degree d is d d−1 pd(x) = adx + ad−1x + ::: + a1x + a0 ; which has d + 1 coefficients. A polynomial interpolant with degree d thus must satisfy d d−1 yi = pd(xi) = adxi + ad−1xi + ::: + a1xi + a0 for i = 1; : : : ; n. This system is a linear system in the unknowns a0; : : : ; an and solving linear systems is what computers do best.
    [Show full text]