From the course: Advanced SQL: Solving Interpolation Challenges

Interpolations

- [Narrator] The general term interpolation refers to the process of adding or inserting something new to an existing object. For example, adding new musical material into a symphony or adding text into an existing manuscript. This is typically by someone other than the original author. The word interpolation comes from the Latin inter, which means between, and polaire, which means to polish or to enhance. There are a few core methods for interpolation and the simplest is officially called piecewise constant interpolation. It's also commonly known as the nearest neighbor, or proximal interpolation. And I, I'm going to use the shortest name. Proximal interpolation assumes that the value of any unknown data point is the same as the closest known one. For example, we can assume that Tuesday's sales were the same as Monday's or the same as Wednesday's. While this approach may seem benign and accurate and oversimplified, you will be surprised just how extensively it is being used. Polynomial interpolation do not borrow their neighbor's values. Instead they use polynomial expressions to estimate a new value that hopefully better fits the curve. Polynomial expressions is just a fancy name for expressions that consists of variables and coefficients and use addition, subtraction, multiplication, and non-negative integer exponents. The expression 3 X squared plus 5 is a polynomial expression. It consists of a variable, X, a positive exponential, 2, and a constant coefficient 3 and 5. Polynomial expressions, in general, can be written as a X to the power of zero plus b X to the power of 1, plus c X squared, et cetera, et cetera. And 3 X squared plus 5 is just a simplified notation for 5 X to the power of zero plus zero X to the power of 1 plus 3 X squared. Linear interpolations are polynomial interpolation, where the exponents are either zero or 1, and they can be written as a X to the power of zero plus b X to the power of 1. You might have heard of other types of interpolation. For example, spline, Lagrangian, rational and trigonometric, just to name a few. If you're interested to read more, I'm going to leave you some links in the code file. But today, we will focus on proximal and linear interpolation. With that said, I think we had enough of the math and it's about time to get down to SQL.

Contents