Interpolation refers to the process of creating new data points given within the given set of data. The below code computes the desired data point within the given range of discrete data sets using the formula given by Gauss and this method known as Gauss’s Forward Method.
Gauss’s Forward Method:
The gaussian interpolation comes under the Central Difference Interpolation Formulae. Suppose we are given the following value of y=f(x) for a set values of x:
X: x0 x1 x2 ………. xn
Y: y0 y1 y2 ………… yn
The differences y1 – y0, y2 – y1, y3 – y2, ……, yn – yn–1 when denoted by Δy0, Δy1, Δy2, ……, Δyn–1 are respectively, called the first forward differences. Thus the first forward differences are :
Δy0 = y1 – y0
and in the same way we can calculate higher order differences.
And after the creating table we calculate the value on the basis of following formula:
Now, Let’s take an example and solve it for better understanding.
From the following table, find the value of e1.17 using Gauss’s Forward formula.
yp = y0 + pΔy0 + (p(p-1)/2!).Δy20 + ((p+1)p(p-1)/3!).Δy30 + …
where p = (x1.17 – x1.15) / h
and h = x1 – x0 = 0.05
so, p = 0.04
Now, we need to calculate Δy0, Δy20, Δy30 … etc.
Put the required values in the formula-
yx = 1.17 = 3.158 + (2/5)(0.162) + (2/5)(2/5 – 1)/2.(0.008) …
yx = 1.17 = 3.2246
Code : Python code for implementing Gauss’s Forward Formula
1 2.7183 0.1394 0.0071 0.0004 0.0 0.0 0.0001 1.05 2.8577 0.1465 0.0075 0.0004 0.0 0.0001 1.1 3.0042 0.154 0.0079 0.0004 0.0001 1.15 3.1582 0.1619 0.0083 0.0005 1.2 3.3201 0.1702 0.0088 1.25 3.4903 0.179 1.3 3.6693 Value at 1.17 is 3.2246
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Newton's Divided Difference Interpolation Formula
- Python String Interpolation
- Interpolation Search visualizer using PyQt5
- Python Scipy - ndimage.interpolation.geometric_transform() function
- Deep Neural net with forward and back propagation from scratch - Python
- How to move back and forward in History using Selenium Python ?
- turtle.forward() method in Python-Turtle
- WebDriver Navigational Commands forward() and backward() in Selenium with Python
- forward driver method - Selenium Python
- Data Visualization with Python Seaborn and Pandas
- Type Casting in Python (Implicit and Explicit) with Examples
- How to Add Outline or Edge Color to Histogram in Seaborn?
- Python - Formable Strings Count in Matrix
- Python - Sort Strings by Case difference
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.