What Is Linear Interpolation
Linear interpolation is a mathematical method used to estimate values between two known data points. It is a technique commonly employed when we have limited data and want to approximate an unknown value within a given range.
The process of linear interpolation is based on the assumption of a linear relationship between data points. By connecting two adjacent data points with a straight line, we can make a reasonable estimation of the value that falls between them. This technique is widely used in fields such as mathematics, physics, finance, and computer science.
Linear Interpolation Formula
Let's denote the lower class boundary of the class interval containing the desired percentile as L, the cumulative frequency of the class before the desired percentile as F, the frequency of the class containing the desired percentile as f, and the width of the class interval as w.
The linear interpolation formula for finding the desired percentile (P) is: P = L + ((N/2 - F) / f) * w Where: - N is the total number of data points - L is the lower class boundary of the class interval containing the desired percentile - F is the cumulative frequency of the class before the desired percentile - f is the frequency of the class containing the desired percentile - w is the width of the class interval.
By using this formula and the given data, we can accurately estimate the median, quartiles, or percentiles of a dataset.
The linear interpolation formula is the simplest method used to estimate the value of a function between any two known points. This formula is also useful for curve fitting using linear polynomials.
Linear interpolation is a widely used mathematical technique in data forecasting, prediction, and various scientific and mathematical applications. It allows us to estimate values within a given range based on known data points. The linear interpolation equation is given by: \[y = y_1 + (x-x_1) \frac{(y_2-y_1)}{(x_2-x_1)}\] where: - \(x_1\) and \(y_1\) are the first coordinates. - \(x_2\) and \(y_2\) are the second coordinates. - \(x\) is the point to perform the interpolation.
y is the interpolated value.
Solved example for linear interpolation
The best way to understand linear interpolation is through the use of an example.
Find the value of y if x = 5 and some set of value given are (3,2), (7,9).
Step 1: First assign each coordinate the right value
x = 5 (note that this is given)
x1 = 3 and y1 = 2
x2 = 7 and y2 = 9
Step 2: Substitute these values into the , then get the answer for y.
y = 2 +(5-3) * ((9-2)/(7-3)) = 11/2
How to do linear interpolation
There are a few useful steps that will help you compute the desired value such as the median, 1 quartile and 3 quartile. We will go through each step with the use of an example so that it is clear.
In this example, we will look at grouped data with class intervals.
Class | Frequency |
0-10 | 5 |
11-20 | 10 |
21-30 | 1 |
31-40 | 8 |
41-50 | 18 |
51-60 | 6 |
Frequency is how often a value in a specific class appears in the data.
Step 1: Given the class and the frequency, you have to create another column called the (also known as CF).
is therefore defined as the running total of frequencies.
Class | Frequency | CF |
0-10 | 5 | 5 |
11-20 | 10 | 15 |
21-30 | 1 | 16 |
31-40 | 8 | 24 |
41-50 | 18 | 42 |
51-60 | 6 | 48 |
Step 2: Step 2: Creating a Cumulative Frequency Graph involves plotting the upper boundaries of each class against their corresponding cumulative frequencies./p>
Finding the median
The median is the value in the middle of the data.
The position of the median is at the \(\Big( \frac{n}{2} \Big)^{th}\) value, where n is the total cumulative frequency.
In this example, n = 68
Step 1: Solve for the position of the median \(\frac{68}{2} = 34^{th} \space position\)
Step 2: Look for where the position lies in the data using the cumulative frequency.
According to the cumulative frequency, the value lies in the 41-50 class interval.
Step 3: Given the graph, use linear interpolation to find the specific median value.
We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.
\(\text{Gradient} = \frac{(\text{Median cf - previous cf})}{(\text{upper bound - lower bound})} =\frac{(42-24)}{(50-41)} = 2\)
In the process of manipulating formulas and implementing linear interpolation, we have the opportunity to substitute the median value (m) as the upper bound. Additionally, we can replace the position of the median with the median cumulative frequency (cf), which is also equivalent to the gradient in this scenario./p>
\(\text{Gradient} = \frac{(34-24)}{(m-41)}\)
So it follows that,
\(2 = \frac{(34-24)}{(m-41)} \quad 2 = \frac{10}{m-41} \quad m-41 = \frac{10}{2} \quad m-41 = 5 \quad m = 46\)
So the median is 46.
Finding the first quartile
The 1 quartile is also known as the lower quartile. This is where the first 25% of the data lies. The position of the quartile is the \(\Big(\frac{n}{4} \Big)^{th}\) value. The steps to find the 1 quartile are very similar to the steps to find the median.
Step 1: solve for the position of the 1 quartile \(\frac{68}{4} = 17^{th} \text{ position}\)
Step 2: Look for where the 17 position lies in the data using the cumulative frequency. According to the cumulative frequency, the 17 value lies in the 31-40 class interval.
Step 3: Given the graph, use linear interpolation to find the specific 1 quartile value.
We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.
\(\text{Gradient} = \frac{(1^{st}\text{quartile cf - previous cf})}{(\text{upper bound - lower bound})} =\frac{(24-16)}{(40-31)} = \frac{8}{9}\)
In applying formula manipulation and linear interpolation, we can substitute the upper bound with the value of the first quartile (Q1). Similarly, the position of the first quartile can be replaced by the first quartile cumulative frequency (Q1 cf), which is also equivalent to the gradient in this context.
\(\text{Gradient} = \frac{(17-16)}{(Q_1-31)}\)
It follows that,
\(\frac{8}{9} = \frac{(17-16)}{(Q_1 - 31)} \quad \frac{8}{9} = \frac{1}{Q_1 - 31} \quad Q_1 - 31 = \frac{9}{8} \quad Q_1 = 32.125\)
So the 1 quartile is 32.125.
Finding the third quartile
The 1 quartile is also known as the lower quartile. This is where the first 25% of the data lies.
The position of the 3 quartile is the \(\Big(\frac{3n}{4} \Big)^{th}\) value.
Step 1: solve for the position of the 3 quartile \(\frac{3(68)}{4} = 51^{st} \text{ position}\)
Step 2: Look for where the 51 position lies in the data using the cumulative frequency.
According to the cumulative frequency, the 51 value lies in the 61-70 class interval.
Step 3: Given the graph, use linear interpolation to find the specific 3 quartile value.
We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.
\(\text{Gradient} = \frac{3^{rd} \text{quartile cf - previous cf}}{\text{upper bound - lower bound}} = \frac{(68-48)}{(70-61)} = \frac{20}{9}\)
In the context of manipulating formulas and applying linear interpolation, we can make use of this technique by substituting the third quartile value (Q3) as the upper bound. Additionally, we can replace the position of the third quartile with the third quartile cumulative frequency (cf), which is equivalent to the gradient in this scenario.
\(\text{Gradient} = \frac{(51-48)}{(Q_3 -61)}\)
\(\frac{20}{9} = \frac{(51-48)}{(Q_3 - 61)} \quad \frac{20}{9} = \frac{3}{Q_3 - 61} \quad Q_3 - 61 = \frac{27}{20} \quad Q_3 = 62.35\)
So the 3 quartile is 32.125.